[Bug tree-optimization/86816] [8/9 Regression] ICE: SIGSEGV in tree-ssa-pre / tail_merge_optimize

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86816

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-08-02
Version|tree-ssa|8.2.0
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |8.3
Summary|[8 Regression] ICE: SIGSEGV |[8/9 Regression] ICE:
   |in tree-ssa-pre /   |SIGSEGV in tree-ssa-pre /
   |tail_merge_optimize |tail_merge_optimize
 Ever confirmed|0   |1
  Known to fail||9.0

--- Comment #1 from Richard Biener  ---
Confirmed.

#1  0x014e9e2a in VN_INFO (name=)
at /tmp/trunk/gcc/tree-ssa-sccvn.c:376
376   gcc_checking_assert (res);

so we are asking for the value-number of sth that didn't get a VN_INFO
comparing

(gdb) p debug_gimple_stmt (s1)
if (pretmp_13 == 1)
$1 = void
(gdb) p debug_gimple_stmt (s2)
if (_16 <= 1)

with _16 being the culprit here.  This SSA name is generated via the
CFG cleanup done between PRE and tail-merging.

#0  make_ssa_name_fn (fn=0x769f8000, var=, 
stmt=, version=0) at /tmp/trunk/gcc/tree-ssanames.c:325
#1  0x012e7739 in make_ssa_name (var=, 
stmt=) at /tmp/trunk/gcc/tree-ssanames.h:115
#2  0x0130397a in generate_range_test (
bb=, index=, 
low=, high=, 
lhs=0x7fffd520, rhs=0x7fffd518) at /tmp/trunk/gcc/tree-cfg.c:9141
#3  0x0130b17a in convert_single_case_switch (swtch=0x768a9a00, 
gsi=...) at /tmp/trunk/gcc/tree-cfgcleanup.c:102
#4  0x0130b2f0 in cleanup_control_expr_graph (
bb=, gsi=...)
at /tmp/trunk/gcc/tree-cfgcleanup.c:141
#5  0x0130b708 in cleanup_control_flow_bb (
bb=)
at /tmp/trunk/gcc/tree-cfgcleanup.c:248
#6  0x0130ce48 in cleanup_control_flow_pre ()
at /tmp/trunk/gcc/tree-cfgcleanup.c:758
#7  0x0130d2a9 in cleanup_tree_cfg_noloop ()
at /tmp/trunk/gcc/tree-cfgcleanup.c:882
#8  0x0130d52d in cleanup_tree_cfg ()
at /tmp/trunk/gcc/tree-cfgcleanup.c:990
#9  0x0153d81f in tail_merge_optimize (todo=32)
at /tmp/trunk/gcc/tree-ssa-tail-merge.c:1732
#10 0x014c3e22 in (anonymous namespace)::pass_pre::execute (
this=0x2f26300, fun=0x769f8000) at /tmp/trunk/gcc/tree-ssa-pre.c:4208

[Bug target/86820] [8 regression] gcc-8 miscompiles binutils on m68k

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86820

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
  Known to work||9.0

[Bug c++/86823] [6/7/8/9 Regression] private member template struct/class is publicly accessible

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86823

Richard Biener  changed:

   What|Removed |Added

   Keywords||accepts-invalid
   Target Milestone|--- |6.5

[Bug c++/86825] g++.old-deja/g++.pt/ptrmem10.C test fails on windows targets

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86825

Richard Biener  changed:

   What|Removed |Added

Version|unknown |9.0

--- Comment #1 from Richard Biener  ---
Just assuming this is a report for trunk.

[Bug tree-optimization/86824] [9 Regression] internal compiler error: in replace_stmt, at tree-vectorizer.c:611

2018-08-02 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86824

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||rsandifo at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |rsandifo at gcc dot 
gnu.org

--- Comment #3 from rsandifo at gcc dot gnu.org  
---
Mine.

[Bug middle-end/86763] [8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

Richard Biener  changed:

   What|Removed |Added

   Keywords||alias
 Status|NEW |ASSIGNED
  Component|rtl-optimization|middle-end

--- Comment #6 from Richard Biener  ---
(In reply to Uroš Bizjak from comment #5)
> (In reply to Richard Biener from comment #3)
> > see how the compare is moved very far away from the branch possibly across
> > flag clobbering insns (rep movsq?).  Target sounds good.
> 
> Scheduler (sched2) pass is moving the compare:
> 
> (insn 21 17 22 2 (set (reg:CCZ 17 flags)
> (compare:CCZ (mem/c:DI (plus:DI (reg/f:DI 7 sp)
> (const_int 8 [0x8])) [1 MEM[(struct Msg &)&t].id+0 S8
> A64])
> (const_int 1001 [0x3e9]))) "t4.cpp":32 12 {*cmpdi_1}
>  (nil))
> 
> in front of rep movsd:
> 
> (insn 11 10 12 2 (parallel [
> (set (reg:DI 2 cx [92])
> (const_int 0 [0]))
> (set (reg/f:DI 5 di [90])
> (plus:DI (ashift:DI (reg:DI 2 cx [92])
> (const_int 3 [0x3]))
> (reg/f:DI 5 di [90])))
> (set (reg/f:DI 4 si [91])
> (plus:DI (ashift:DI (reg:DI 2 cx [92])
> (const_int 3 [0x3]))
> (reg/f:DI 4 si [91])))
> (set (mem/c:BLK (reg/f:DI 5 di [90]) [7 MEM[(struct T *)&t]+0
> S232 A128])
> (mem/c:BLK (reg/f:DI 4 si [91]) [7 MEM[(struct T
> *)&D.2891]+0 S232 A128]))
> (use (reg:DI 2 cx [92]))
> ]) "t4.cpp":31 993 {*rep_movdi_rex64}
>  (expr_list:REG_UNUSED (reg:DI 2 cx [92])
> (nil)))
> 
> Scheduler doesn't notice that rep movsd target overlaps compare operand.
> 
> Looks like rtl-optimization (scheduler) to me.

I notice that -O -fstrict-aliasing -fschedule-insns2 fails and -O2
-fno-strict-aliasing succeeds.  The above shows the block move uses alias-set 7
and the
compare alias-set 1.  Alias set 1 is a subset of alias set 7 but not the
other way around - this suggests that sched-deps is querying the oracle
in a wrong way.  Huh, no.

Breakpoint 2, true_dependence_1 (mem=0x76a5ec00, mem_mode=E_QImode, 
mem_addr=0x3106258, x=0x76a5edb0, x_addr=0x76a61780, 
mem_canonicalized=true)
at /space/rguenther/src/svn/gcc-8-branch/gcc/alias.c:2905
2905  gcc_checking_assert (mem_canonicalized ? (mem_addr != NULL_RTX)
(mem/c:QI (reg/f:DI 90) [7 MEM[(struct T *)&t]+236 S1 A32])
$27 = void
(mem/c:DI (plus:DI (reg/f:DI 20 frame)
(const_int -232 [0xff18])) [1 MEM[(struct Msg &)&t].id+0 S8
A64])
$28 = void
(gdb) fin
Run till exit from #0  true_dependence_1 (mem=0x76a5ec00, 
mem_mode=E_QImode, mem_addr=0x3106258, x=0x76a5edb0, 
x_addr=0x76a61780, mem_canonicalized=true)
at /space/rguenther/src/svn/gcc-8-branch/gcc/alias.c:2905
canon_true_dependence (mem=0x76a5ec00, mem_mode=E_QImode, 
mem_addr=0x3106258, x=0x76a5edb0, x_addr=0x76a61780)
at /space/rguenther/src/svn/gcc-8-branch/gcc/alias.c:2998
2998}
Value returned is $29 = 0

so the oracle says the load cannot alias the store.  We enter with

(gdb) p debug_rtx (mem_addr)
(value:DI 10:17131 @0x3106258/0x30e6310)
(gdb) p debug_rtx (x_addr)
(plus:DI (reg/f:DI 20 frame)
(const_int -232 [0xff18]))

and find_base_term (x_addr) returns (address:DI -3) (same as mem_base)

Hmm.  alias_sets_conflict_p returns false?!  Ah, alias_set_subset_of
returns true because of has_zero_child.  alias-set 7 has no children,
it looks like struct T has no members but it does have a member of type V.

So we do record_component_aliases arriving at that field and get_alias_set
on this field returns zero due to TYPE_TYPELESS_STORAGE (which is new
in GCC 8 which explains why there may be a regression).  So we record
the ->has_zero_child relationship (instead of previously recording
a distinct alias-set).

Now - some earlier change - improvement to alias_sets_conflict_p in fact,
made us not consider ->has_zero_child there basically to avoid making
struct X { int i; }; and struct Y { float f; char x[4]; } conflict.  But
this is exactly what we are trying to allow with TYPE_TYPELESS_STORAGE :/

So TYPE_TYPELESS_STORAGE doesn't work as desired and introduces wrong-code.

[Bug middle-end/86763] [7/8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

Richard Biener  changed:

   What|Removed |Added

  Known to work||6.4.0
Summary|[8/9 Regression] Wrong code |[7/8/9 Regression] Wrong
   |comparing member of copy of |code comparing member of
   |a 237 byte object with  |copy of a 237 byte object
   |nontrivial default  |with nontrivial default
   |constructor on x86-64 arch  |constructor on x86-64 arch
  Known to fail||7.1.0

--- Comment #7 from Richard Biener  ---
Also fails with GCC 7 (not with -O2 but with -O -fstrict-aliasing
-fschedule-insns2), same reason.

[Bug target/86774] Alpha port needs updating for CVE-2017-5753

2018-08-02 Thread mcree at orcon dot net.nz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86774

Michael Cree  changed:

   What|Removed |Added

 CC||mcree at orcon dot net.nz

--- Comment #2 from Michael Cree  ---
Just to note that in testing earlier this year I managed to successfully run
meltdown and spectre v1 attacks on Alpha EV68 hardware.  These attacks were
less successful on EV67 (only a 1% to 2% success rate). I failed to get any
attack on EV56---cache timings did not reveal anything useful (though I did not
spend too much time analysing this case).

[Bug c++/86763] [7/8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
 CC||jason at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
  Component|middle-end  |c++

--- Comment #8 from Richard Biener  ---
So the question is why T doesn't get TYPE_TYPELESS_STORAGE set even though
we propagate that flag from children upwards in place_field.  That's what
is missing here and why things go wrong.

Ah, so we go

build_base_field (rli=0x2ea1780, binfo=0x76a2f120, offsets=0x2ea2280, 
next_field=0x76a285c8)
at /space/rguenther/src/svn/gcc-8-branch/gcc/cp/class.c:4244
4244  tree t = rli->t;
(gdb) p basetype->type_common.typeless_storage 
$30 = 1

OK

4262  decl = build_base_field_1 (t, basetype, next_field);
(gdb) p decl->typed.type->type_common.typeless_storage 
$31 = 0

looks like the as-base type doesn't inherit this flag.  If I fix that up here
where it matters rather than tracking down the gazillion places the C++ FE
seems to set CLASSTYPE_AS_BASE and where I'm unsure at that time layout
is finished the bug is fixed:

Index: gcc/cp/class.c
===
--- gcc/cp/class.c  (revision 263209)
+++ gcc/cp/class.c  (working copy)
@@ -4202,6 +4202,8 @@ build_base_field_1 (tree t, tree basetyp
 {
   /* Create the FIELD_DECL.  */
   gcc_assert (CLASSTYPE_AS_BASE (basetype));
+  TYPE_TYPELESS_STORAGE (CLASSTYPE_AS_BASE (basetype))
+= TYPE_TYPELESS_STORAGE (basetype);
   tree decl = build_decl (input_location,
  FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype));
   DECL_ARTIFICIAL (decl) = 1;


C++ folks?

[Bug c++/86763] [7/8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

--- Comment #9 from Richard Biener  ---
The following seems to work, will test.

Index: gcc/cp/class.c
===
--- gcc/cp/class.c  (revision 263209)
+++ gcc/cp/class.c  (working copy)
@@ -6243,6 +6243,7 @@ layout_class_type (tree t, tree *virtual
  bitsize_int (BITS_PER_UNIT)));
   SET_TYPE_ALIGN (base_t, rli->record_align);
   TYPE_USER_ALIGN (base_t) = TYPE_USER_ALIGN (t);
+  TYPE_TYPELESS_STORAGE (base_t) = TYPE_TYPELESS_STORAGE (t);

   /* Copy the non-static data members of T. This will include its
 direct non-virtual bases & vtable.  */

[Bug c/86827] New: -Warray-bounds produces negative indicies

2018-08-02 Thread liuw at liuw dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827

Bug ID: 86827
   Summary: -Warray-bounds produces negative indicies
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: liuw at liuw dot name
  Target Milestone: ---

Created attachment 44484
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44484&action=edit
Test code

The attached program fails to build with gcc 8.1 (Debian 8.1.0-12).

$ gcc  -m32 -march=i686 -std=gnu99 -Wall -O2   -Werror   -c -o t.o t.c  
t.c: In function 'func':
t.c:41:9: error: 'memcpy' offset [-204, -717] is out of the bounds [0, 216] of
object 'ctrl' with type 'struct kdd_ctrl' [-Werror=array-bounds]
 memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
^
t.c:27:21: note: 'ctrl' declared here
 struct kdd_ctrl ctrl; 

And to quote Martin in a thread to gcc-help:

It looks like a bug in the implementation of the warning.
The offset is determined not to be in the range [-205, -716]
(pointer offsets are in ptrdiff_t) or (since the variable is
unsigned) in [4294966580, 4294967091].  That means that it
can be either in the range [0, 4294966579] or in [4294967092,
UINT_MAX].  But the warning code seems to get this anti-range
wrong and treats it as [-204, -717].

[Bug c++/86763] [7/8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

[Bug c/86827] [8/9 Regression] -Warray-bounds produces negative indicies

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic
 CC||msebor at gcc dot gnu.org
   Target Milestone|--- |8.3
Summary|-Warray-bounds produces |[8/9 Regression]
   |negative indicies   |-Warray-bounds produces
   ||negative indicies

--- Comment #1 from Richard Biener  ---
hand-rolled range handling code again :/

[Bug target/86802] riscv port needs updating for CVE-2017-5753

2018-08-02 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86802

--- Comment #2 from Richard Earnshaw  ---
I think the best thing to do in that case is to leave the port unfixed until
such time as you know what mitigation is appropriate.  That way the compiler
will not define __HAVE_SPECULATION_SAFE_VALUE and users will not be given a
false sense of security: if they have code that checks for whether mitigation
is needed, the lack of the define will tell them that it isn't known yet.

It won't stop them using the new builtin, but it will lead to a warning if used
in this state.

[Bug target/85434] Address of stack protector guard spilled to stack on ARM

2018-08-02 Thread thopre01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85434

--- Comment #18 from Thomas Preud'homme  ---
Author: thopre01
Date: Thu Aug  2 09:07:17 2018
New Revision: 263245

URL: https://gcc.gnu.org/viewcvs?rev=263245&root=gcc&view=rev
Log:
[ARM] Fix PR85434: spilling of stack protector guard's address on ARM

In case of high register pressure in PIC mode, address of the stack
protector's guard can be spilled on ARM targets as shown in PR85434,
thus allowing an attacker to control what the canary would be compared
against. This is also known as CVE-2018-12886. ARM does lack
stack_protect_set and stack_protect_test insn patterns, defining them
does not help as the address is expanded regularly and the patterns
only deal with the copy and test of the guard with the canary.

This problem does not occur for x86 targets because the PIC access and
the test can be done in the same instruction. Aarch64 is exempt too
because PIC access insn pattern are mov of UNSPEC which prevents it from
the second access in the epilogue being CSEd in cse_local pass with the
first access in the prologue.

The approach followed here is to create new "combined" set and test
standard pattern names that take the unexpanded guard and do the set or
test. This allows the target to use an opaque pattern (eg. using UNSPEC)
to hide the individual instructions being generated to the compiler and
split the pattern into generic load, compare and branch instruction
after register allocator, therefore avoiding any spilling. This is here
implemented for the ARM targets. For targets not implementing these new
standard pattern names, the existing stack_protect_set and
stack_protect_test pattern names are used.

To be able to split PIC access after register allocation, the functions
had to be augmented to force a new PIC register load and to control
which register it loads into. This is because sharing the PIC register
between prologue and epilogue could lead to spilling due to CSE again
which an attacker could use to control what the canary gets compared
against.

2018-08-02  Thomas Preud'homme  

gcc/
PR target/85434
* target-insns.def (stack_protect_combined_set): Define new standard
pattern name.
(stack_protect_combined_test): Likewise.
* cfgexpand.c (stack_protect_prologue): Try new
stack_protect_combined_set pattern first.
* function.c (stack_protect_epilogue): Try new
stack_protect_combined_test pattern first.
* config/arm/arm.c (require_pic_register): Add pic_reg and compute_now
parameters to control which register to use as PIC register and force
reloading PIC register respectively.  Insert in the stream of insns if
possible.
(legitimize_pic_address): Expose above new parameters in prototype and
adapt recursive calls accordingly.
(arm_legitimize_address): Adapt to new legitimize_pic_address
prototype.
(thumb_legitimize_address): Likewise.
(arm_emit_call_insn): Adapt to new require_pic_register prototype.
* config/arm/arm-protos.h (legitimize_pic_address): Adapt to prototype
change.
* config/arm/arm.md (movsi expander): Adapt to legitimize_pic_address
prototype change.
(stack_protect_combined_set): New insn_and_split pattern.
(stack_protect_set): New insn pattern.
(stack_protect_combined_test): New insn_and_split pattern.
(stack_protect_test): New insn pattern.
* config/arm/unspecs.md (UNSPEC_SP_SET): New unspec.
(UNSPEC_SP_TEST): Likewise.
* doc/md.texi (stack_protect_combined_set): Document new standard
pattern name.
(stack_protect_set): Clarify that the operand for guard's address is
legal.
(stack_protect_combined_test): Document new standard pattern name.
(stack_protect_test): Clarify that the operand for guard's address is
legal.

gcc/testsuite/
PR target/85434
* gcc.target/arm/pr85434.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/arm/pr85434.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/config/arm/arm-protos.h
trunk/gcc/config/arm/arm.c
trunk/gcc/config/arm/arm.md
trunk/gcc/config/arm/unspecs.md
trunk/gcc/doc/md.texi
trunk/gcc/function.c
trunk/gcc/target-insns.def
trunk/gcc/testsuite/ChangeLog

[Bug sanitizer/86022] TCB size calculated in ThreadDescriptorSize() is wrong for glibc-2.14

2018-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86022

--- Comment #4 from Martin Liška  ---
Author: marxin
Date: Thu Aug  2 09:32:58 2018
New Revision: 263246

URL: https://gcc.gnu.org/viewcvs?rev=263246&root=gcc&view=rev
Log:
Cherry-pick compiler-rt revision 338606 (PR sanitizer/86022).

Fix sizeof(struct pthread) in glibc 2.14.

2018-08-02  Martin Liska  

PR sanitizer/86022
* sanitizer_common/sanitizer_linux_libcdep.cc (ThreadDescriptorSize):
Cherry-pick compiler-rt revision 338606.

Modified:
trunk/libsanitizer/ChangeLog
trunk/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

[Bug sanitizer/86022] TCB size calculated in ThreadDescriptorSize() is wrong for glibc-2.14

2018-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86022

Martin Liška  changed:

   What|Removed |Added

  Known to work||9.0
  Known to fail|9.0 |

--- Comment #5 from Martin Liška  ---
Fixed on trunk so far.

[Bug target/86758] [9 Regression] ICE in replace_stmt compiling gcc.target/i386/pr84309.c

2018-08-02 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86758

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #5 from rsandifo at gcc dot gnu.org  
---
*** Bug 86824 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/86824] [9 Regression] internal compiler error: in replace_stmt, at tree-vectorizer.c:611

2018-08-02 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86824

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from rsandifo at gcc dot gnu.org  
---
Seems to be the same as PR86758, which was fixed in r263222.  Sorry again for
the breakage.

*** This bug has been marked as a duplicate of bug 86758 ***

[Bug tree-optimization/86702] [9 Regression] SPEC CPU2006 400.perlbench, CPU2017 500.perlbench_r ~3% performance drop after r262247

2018-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86702

--- Comment #2 from Martin Liška  ---
Can you please provide info about affected target and precise options used?

[Bug tree-optimization/86702] [9 Regression] SPEC CPU2006 400.perlbench, CPU2017 500.perlbench_r ~3% performance drop after r262247

2018-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86702

--- Comment #3 from Martin Liška  ---
I must confirm that probabilities are lost, but as the switch will end up as
jump table, so they are not used..

[Bug target/86828] New: [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

Bug ID: 86828
   Summary: [6/7 Regression] wrong-code bug with "-march=knl
-Ofast" (invalid memory reference)
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Fortran test case:


program knl_bug

   implicit none

   integer, parameter :: NN = 32

   type tList
  integer, dimension(:), allocatable :: list
   end type

   integer, dimension(1:100) :: Y = 0
   type(tList) :: nb

   allocate(nb%list(1:NN), source = 1)

   call s(nb)

contains

   subroutine s(n)
  type(tList), intent(in) :: n

  integer, dimension(1:NN) :: liKOB

  liKOB = Y(n%list)
  print *,liKOB

   end subroutine

end


Compiling this with "gfortran -march=knl -Ofast -g", and then running the
executable, I get:

$ ./a.out 

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f9d495c42da in ???
#1  0x7f9d495c3503 in ???
#2  0x7f9d491f6f1f in ???
#3  0x563dd9a3dd7f in s
at test.f90:26
#4  0x563dd9a3da9a in knl_bug
at test.f90:17
#5  0x563dd9a3da9a in main
at test.f90:17
Segmentation fault (core dumped)


I see this happening with:
gcc version 6.4.0 20180727 (Ubuntu 6.4.0-19ubuntu1~18.04)
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

but not with:
gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1)
gcc version 8.2.0 (Ubuntu 8.2.0-1ubuntu2~18.04)
gcc version 9.0.0 20180730 (experimental) [trunk revision 263059] (GCC)

Note that the segfault also happens with -march=skylake-avx512 (which is not
available with gcc 5).

Similar to PR 86735.

The CPU where I found this is an Intel(R) Core(TM) i9-7980XE.

[Bug target/86828] [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||wrong-code
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=86735
   Target Milestone|--- |6.5

[Bug gcov-profile/86817] [8/9 Regression] Misleading warning in gcov since r254672

2018-08-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86817

--- Comment #1 from Martin Liška  ---
Author: marxin
Date: Thu Aug  2 10:17:34 2018
New Revision: 263248

URL: https://gcc.gnu.org/viewcvs?rev=263248&root=gcc&view=rev
Log:
Fix gcov misleading error (PR gcov-profile/86817).

2018-08-02  Martin Liska  

PR gcov-profile/86817
* gcov.c (process_all_functions): New function.
(main): Call it.
(process_file): Move functions processing to
process_all_functions.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcov.c

[Bug target/86771] [9 Regression] gfortran.dg/actual_array_constructor_1.f90 fails on arm after combine 2 insns to 2 insns patch

2018-08-02 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86771

--- Comment #1 from Segher Boessenkool  ---
Could you trace this down to some bad code generated, at least?

[Bug middle-end/86815] [8/9 regression] ICE on valid code on armhf

2018-08-02 Thread costamagnagianfranco at yahoo dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86815

--- Comment #6 from Gianfranco  ---
Created attachment 44485
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44485&action=edit
another failing output

I'm attaching another file suffering from the same issue (mostly every cpp file
has this failure)
this file is only ~2Mb, so maybe reducing it might be easier

[Bug target/86014] [AArch64] missed LDP optimization

2018-08-02 Thread jcw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86014

--- Comment #2 from jcw at gcc dot gnu.org ---
Author: jcw
Date: Thu Aug  2 10:39:23 2018
New Revision: 263249

URL: https://gcc.gnu.org/viewcvs?rev=263249&root=gcc&view=rev
Log:
gcc/
2018-08-02  Jackson Woodruff  

PR target/86014
* config/aarch64/aarch64.c (aarch64_operands_adjust_ok_for_ldpstp):
No longer check last store for clobber of address register.


gcc/testsuite
2018-08-02  Jackson Woodruff  

PR target/86014
* gcc.target/aarch64/ldp_stp_13.c: New test.



Added:
trunk/gcc/testsuite/gcc.target/aarch64/ldp_stp_13.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64.c
trunk/gcc/testsuite/ChangeLog

[Bug target/86771] [9 Regression] gfortran.dg/actual_array_constructor_1.f90 fails on arm after combine 2 insns to 2 insns patch

2018-08-02 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86771

--- Comment #2 from Christophe Lyon  ---
gfortran.log contains:
STOP 4
STOP 4
STOP 4
before the execution fails

I'll regenerate the 2 asm files.

[Bug target/86014] [AArch64] missed LDP optimization

2018-08-02 Thread jcw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86014

jcw at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jcw at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from jcw at gcc dot gnu.org ---
Fixed by r263249.

[Bug target/86781] fr30 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86781

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 11:24:47 2018
New Revision: 263253

URL: https://gcc.gnu.org/viewcvs?rev=263253&root=gcc&view=rev
Log:
PR target/86781
* config/fr30/fr30.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define to
speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/fr30/fr30.c

[Bug target/86781] fr30 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86781

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86781, which changed state.

Bug 86781 Summary: fr30 port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86781

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/86829] New: Missing sin(atan(x)) and cos(atan(x)) optimizations

2018-08-02 Thread giuliano.belinassi at usp dot br
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86829

Bug ID: 86829
   Summary: Missing sin(atan(x)) and cos(atan(x)) optimizations
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: giuliano.belinassi at usp dot br
  Target Milestone: ---

Created attachment 44486
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44486&action=edit
add sin(atan(x)) and cos(atan(x)) substitutions rules.

The file named 'match.pd' does not contain the following simplifications rules:
sin(atan(x)) -> x / sqrt(x*x + 1)  and  cos(atan(x)) -> 1 / sqrt(x*x + 1).
According to the simple brenchmark I made, these substitutions can provide  a
10x speedup in the code. I wrote a patch to add these optimizations.

link to the perf test: https://pastebin.com/5ujSRmhq

assembly dump of the perftest: https://pastebin.com/gLJeWHY8

The code I wrote add an instruction 'CVTSS2SD'. I don't know why it happens.

[Bug target/86782] frv port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86782

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 11:46:06 2018
New Revision: 263254

URL: https://gcc.gnu.org/viewcvs?rev=263254&root=gcc&view=rev
Log:
PR target/86782
* config/frv/frv.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define to
speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/frv/frv.c

[Bug target/86787] iq2000 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86787

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86787, which changed state.

Bug 86787 Summary: iq2000 port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86787

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/86829] Missing sin(atan(x)) and cos(atan(x)) optimizations

2018-08-02 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86829

--- Comment #1 from Marc Glisse  ---
You shouldn't use float_type_node directly, since the operations might be on
double or long double.

Do you have a copyright assignment (https://gcc.gnu.org/contribute.html) ?

[Bug target/86782] frv port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86782

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE
speculation_safe_value_not_needed

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86782, which changed state.

Bug 86782 Summary: frv port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86782

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/86829] Missing sin(atan(x)) and cos(atan(x)) optimizations

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86829

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization, patch
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-08-02
 CC||rguenth at gcc dot gnu.org
Version|unknown |9.0
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
+ /* Simplify sin(atan(x)) -> x / sqrt(x*x + 1). */
+ (for sins (SIN)
+  atans (ATAN)
+  sqrts (SQRT)
+  (simplify
+   (sins (atans @0))
+   (rdiv @0 ( sqrts (plus (mult @0 @0) 
+   { build_one_cst (float_type_node);})
+ 
+ 
+ /* Simplify cos(atan(x)) -> 1 / sqrt(x*x + 1). */
+ (for coss (COS)
+  atans (ATAN)
+  sqrts (SQRT)
+  (simplify
+   (coss (atans @0))
+   (rdiv { build_one_cst (float_type_node);} 
+   ( sqrts (plus (mult @0 @0) { build_one_cst (float_type_node);})


likely happens because you use float_type_node instead of 'type' for
build_one_cst.  I think that if the atan intermediate result has additional
uses then the substitution may not be beneficial?  Thus you should
write (atans:s @0) in both places.

Otherwise this looks OK.  Can you please post the patch to gcc-patches
and add testcases?

[Bug target/86771] [9 Regression] gfortran.dg/actual_array_constructor_1.f90 fails on arm after combine 2 insns to 2 insns patch

2018-08-02 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86771

--- Comment #3 from Christophe Lyon  ---
Created attachment 44487
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44487&action=edit
Wrong code generated

This is with trunk @r263197

[Bug target/86828] [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

Richard Biener  changed:

   What|Removed |Added

   Keywords||needs-bisection
 Target||x86_64-*-*, i?86-*-*

--- Comment #1 from Richard Biener  ---
Would be nice to know what fixed this (or maybe know if it just went latent).

[Bug target/86771] [9 Regression] gfortran.dg/actual_array_constructor_1.f90 fails on arm after combine 2 insns to 2 insns patch

2018-08-02 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86771

--- Comment #4 from Christophe Lyon  ---
Created attachment 44488
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44488&action=edit
Good code

This is with r263197 and r263067 (your patch) reverted

[Bug target/86771] [9 Regression] gfortran.dg/actual_array_constructor_1.f90 fails on arm after combine 2 insns to 2 insns patch

2018-08-02 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86771

--- Comment #5 from Christophe Lyon  ---
I think in the "ok" version we have:
add ip, sp, #60
...
ldm ip, {r0, r1}
...
add r2, sp, #72
ldm r2, {r0, r1}

in the "ko" version we have:
ldr r1, [sp, #64]
...
ldr r1, [sp, #76]

So in the "ko" version we do not load r0

[Bug target/86787] iq2000 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86787

--- Comment #2 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 12:14:52 2018
New Revision: 263255

URL: https://gcc.gnu.org/viewcvs?rev=263255&root=gcc&view=rev
Log:
PR target/86787
* config/iq2000/iq2000.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/iq2000/iq2000.c

[Bug target/86828] [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

--- Comment #2 from janus at gcc dot gnu.org ---
(In reply to Richard Biener from comment #1)
> Would be nice to know what fixed this (or maybe know if it just went latent).

I think I remember having some intermediate versions during the reduction that
failed also with 8 and trunk. So I'd guess it just went dormant, or the
segfault depends on memory layout or something.

Wanted to try valgrind on the exe, but it seems it doesn't support AVX-512 yet
(at least the version I have).

[Bug target/85434] Address of stack protector guard spilled to stack on ARM

2018-08-02 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85434

Christophe Lyon  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #19 from Christophe Lyon  ---
Created attachment 44489
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44489&action=edit
Source file causing ICE on aarch64

With your patch, GCC crashes with target aarch64-none-linux-gnu
aarch64-none-linux-gnu-gcc gethnamaddr.i -fstack-protector  
during RTL pass: expand
gethnamaddr.c: In function 'getanswer':
gethnamaddr.c:179:1: internal compiler error: in maybe_gen_insn, at
optabs.c:7307
 getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
 ^
0xafcef2 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/optabs.c:7307
0xaffb88 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
/home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/optabs.c:7351
0x7748a0 stack_protect_prologue
   
/home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/cfgexpand.c:6117
0x7748a0 execute
   
/home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/cfgexpand.c:6357
Please submit a full bug report,

[Bug target/85434] Address of stack protector guard spilled to stack on ARM

2018-08-02 Thread thopre01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85434

--- Comment #20 from Thomas Preud'homme  ---
(In reply to Christophe Lyon from comment #19)
> Created attachment 44489 [details]
> Source file causing ICE on aarch64
> 
> With your patch, GCC crashes with target aarch64-none-linux-gnu
> aarch64-none-linux-gnu-gcc gethnamaddr.i -fstack-protector  
> 
> during RTL pass: expand
> gethnamaddr.c: In function 'getanswer':
> gethnamaddr.c:179:1: internal compiler error: in maybe_gen_insn, at
> optabs.c:7307
>  getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
>  ^
> 0xafcef2 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
> /home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/optabs.c:7307
> 0xaffb88 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
> /home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/optabs.c:7351
> 0x7748a0 stack_protect_prologue
>
> /home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/cfgexpand.c:6117
> 0x7748a0 execute
>
> /home/christophe.lyon/src/GCC/sources/gcc-fsf/trunk/gcc/cfgexpand.c:6357
> Please submit a full bug report,

Thanks Christophe,

It seems to have impacted x86 as well. I'll look at all those and respin the
patch. I've reverted it in the meantime.

[Bug target/86789] m32r port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86789

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 12:31:29 2018
New Revision: 263256

URL: https://gcc.gnu.org/viewcvs?rev=263256&root=gcc&view=rev
Log:
PR target/86789
* config/m32r/m32r.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/m32r/m32r.c

[Bug target/86789] m32r port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86789

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86789, which changed state.

Bug 86789 Summary: m32r port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86789

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/86829] Missing sin(atan(x)) and cos(atan(x)) optimizations

2018-08-02 Thread giuliano.belinassi at usp dot br
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86829

--- Comment #3 from Giuliano Belinassi  ---
(In reply to Marc Glisse from comment #1)
> 
> Do you have a copyright assignment (https://gcc.gnu.org/contribute.html) ?

No. Sorry, but I think I may need help getting this right. Are there any tips?

(In reply to Richard Biener from comment #2)
> likely happens because you use float_type_node instead of 'type' for
> build_one_cst.  I think that if the atan intermediate result has additional
> uses then the substitution may not be beneficial?  Thus you should
> write (atans:s @0) in both places.
> 
> Otherwise this looks OK.  Can you please post the patch to gcc-patches
> and add testcases?

I will fix these issues and add some test cases. I appreciate your help!

[Bug fortran/86830] New: Contiguous array pointer function result not recognized as contiguous

2018-08-02 Thread only_for_nouse at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86830

Bug ID: 86830
   Summary: Contiguous array pointer function result not
recognized as contiguous
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: only_for_nouse at gmx dot de
  Target Milestone: ---

Created attachment 44490
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44490&action=edit
REproducer of the error

Compiling the attached code given the error:
   loc_g => petsc_o%g_dv%get_ptr()
   1
Error: Assignment to contiguous pointer from non-contiguous target at (1)

although the get_ptr function of the dist_func_t datatype returns a contiguous
pointer. 

Remark: Using a polymorphic variable petsc_o instead of a static type, the
error does not occur. The same is true if one omits one level of nesting of
types.

[Bug tree-optimization/86816] [8/9 Regression] ICE: SIGSEGV in tree-ssa-pre / tail_merge_optimize

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86816

--- Comment #2 from Richard Biener  ---
Author: rguenth
Date: Thu Aug  2 13:19:50 2018
New Revision: 263257

URL: https://gcc.gnu.org/viewcvs?rev=263257&root=gcc&view=rev
Log:
2018-08-02  Richard Biener  

PR tree-optimization/86816
* tree-ssa-tail-merge.c (tail_merge_valueize): New function
which checks for value availability before querying it.
(gvn_uses_equal): Use it.
(same_succ_hash): Likewise.
(gimple_equal_p): Likewise.

* g++.dg/torture/pr86816.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr86816.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-tail-merge.c

[Bug tree-optimization/86816] [8 Regression] ICE: SIGSEGV in tree-ssa-pre / tail_merge_optimize

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86816

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||9.0
Summary|[8/9 Regression] ICE:   |[8 Regression] ICE: SIGSEGV
   |SIGSEGV in tree-ssa-pre /   |in tree-ssa-pre /
   |tail_merge_optimize |tail_merge_optimize
  Known to fail|9.0 |

--- Comment #3 from Richard Biener  ---
Fixed on trunk sofar.

[Bug target/86828] [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #3 from H.J. Lu  ---
I can't reproduce it with gcc version 7.3.1 20180609.

[Bug target/86831] New: three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

Bug ID: 86831
   Summary: three failures in gfortran.fortran-torture with
"-Ofast -march=native" on skylake-avx512
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Triggered by two recent avx512 bugs with Fortran code (PR 86735 and PR 86828),
I just tried the following:


Index: gcc/testsuite/lib/fortran-torture.exp
===
--- gcc/testsuite/lib/fortran-torture.exp   (revision 263255)
+++ gcc/testsuite/lib/fortran-torture.exp   (working copy)
@@ -81,6 +81,7 @@
{ -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \
{ -O2 -fbounds-check } \
{ -O3 -g } \
+   { -Ofast -march=native } \
{ -Os }
 if { $test_tree_vectorize } {
lappend options $vectorizer_options


Running "make check-fortran" with this mod on a skylake-avx512 CPU yields the
following failures:

FAIL: gfortran.fortran-torture/execute/in-pack.f90 execution,  -Ofast
-march=native 
FAIL: gfortran.fortran-torture/execute/intrinsic_nearest.f90 execution,  -Ofast
-march=native 
FAIL: gfortran.fortran-torture/execute/nan_inf_fmt.f90 execution,  -Ofast
-march=native

[Bug target/86791] mcore port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86791

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 13:30:40 2018
New Revision: 263258

URL: https://gcc.gnu.org/viewcvs?rev=263258&root=gcc&view=rev
Log:
PR target/86791
* config/mcore/mcore.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/mcore/mcore.c

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86791, which changed state.

Bug 86791 Summary: mcore port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86791

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug target/86791] mcore port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86791

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug target/86831] three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
> Running "make check-fortran" with this mod on a skylake-avx512 CPU yields
> the following failures:
> 
> FAIL: gfortran.fortran-torture/execute/in-pack.f90 execution,  -Ofast
> -march=native 

this one fails with "STOP 10"

> FAIL: gfortran.fortran-torture/execute/intrinsic_nearest.f90 execution, 
> -Ofast -march=native 

"STOP 1"


> FAIL: gfortran.fortran-torture/execute/nan_inf_fmt.f90 execution,  -Ofast
> -march=native

"STOP 3"

[Bug target/86797] msp430 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86797

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 14:02:32 2018
New Revision: 263259

URL: https://gcc.gnu.org/viewcvs?rev=263259&root=gcc&view=rev
Log:
PR target/86797
* config/msp430/msp430.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/msp430/msp430.c

[Bug target/86831] three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

--- Comment #2 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
> Running "make check-fortran" with this mod on a skylake-avx512 CPU yields
> the following failures:

None of them fails with -march=native alone.

[Bug target/86831] three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
> FAIL: gfortran.fortran-torture/execute/intrinsic_nearest.f90 execution, 
> -Ofast -march=native 
> FAIL: gfortran.fortran-torture/execute/nan_inf_fmt.f90 execution,  -Ofast
> -march=native

Those two fail already with -Ofast alone.

[Bug middle-end/86505] [6/7/8/9 Regression] __builtin_va_arg_pack_len() computes the number of arguments wrongly

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86505

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #3 from Richard Biener  ---
Created attachment 44491
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44491&action=edit
candidate patch

I am testing this patch which fixes the testcase.  Test coverage is low though.

[Bug c++/86763] [7/8/9 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Thu Aug  2 14:25:57 2018
New Revision: 263261

URL: https://gcc.gnu.org/viewcvs?rev=263261&root=gcc&view=rev
Log:
2018-08-02  Richard Biener  

PR c++/86763
* class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE
to the CLASSTYPE_AS_BASE.

* g++.dg/torture/pr86763.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr86763.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/86763] [7/8 Regression] Wrong code comparing member of copy of a 237 byte object with nontrivial default constructor on x86-64 arch

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86763

Richard Biener  changed:

   What|Removed |Added

  Known to work||9.0
Summary|[7/8/9 Regression] Wrong|[7/8 Regression] Wrong code
   |code comparing member of|comparing member of copy of
   |copy of a 237 byte object   |a 237 byte object with
   |with nontrivial default |nontrivial default
   |constructor on x86-64 arch  |constructor on x86-64 arch

--- Comment #11 from Richard Biener  ---
Fixed on trunk sofar.

[Bug target/86831] three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

--- Comment #4 from Richard Biener  ---
"nan_inf_fmt" suggests that the 'fast' part in -Ofast might be the issue.  So
try -O3 -march=native instead?

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86797, which changed state.

Bug 86797 Summary: msp430 port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86797

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug target/86797] msp430 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86797

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as 
speculation_safe_value_not_needed.

[Bug target/86803] rx port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86803

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 14:35:10 2018
New Revision: 263263

URL: https://gcc.gnu.org/viewcvs?rev=263263&root=gcc&view=rev
Log:
PR target/86803
* config/rx/rx.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rx/rx.c

[Bug target/86831] three failures in gfortran.fortran-torture with "-Ofast -march=native" on skylake-avx512

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831

--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to Richard Biener from comment #4)
> "nan_inf_fmt" suggests that the 'fast' part in -Ofast might be the issue. 
> So try -O3 -march=native instead?

All three tests pass with those flags.

As just mentioned, 'intrinsic_nearest' and 'nan_inf_fmt' fail with -Ofast alone
(and with basically all recent gfortran versions, at least 5 to trunk). I'm not
so much worried about these.


However, in-pack.f90 is the only one that is made to fail by the combination of
-Ofast and -march=skylake-avx512. I think it's the same problem as PR 86735 (at
least it behaves in the same way).

Here is a reduction that shows the failure:

program main
  implicit none
  complex(kind=8) :: a8(5),b8(5)
  integer :: i

  a8 = (/(cmplx(i,-i,kind=8),i=1,5)/)
  b8 = (/(2*cmplx(i,-i,kind=8),i=1,5)/)
  call csub8(a8(5:1:-1),b8(5:1:-1),5)
end program main

subroutine csub8(a,b,n)
  implicit none
  complex(kind=8), dimension(n) :: a,b
  complex(kind=8), dimension(n) :: aa, bb
  integer :: n, i
  aa = (/(cmplx(n-i+1,i-n-1,kind=8),i=1,n)/)
  if (any(aa /= a)) STOP 9
  bb = (/(2*cmplx(n-i+1,i-n-1,kind=8),i=1,5)/)
  if (any(bb /= b)) STOP 10
end subroutine csub8

[Bug target/86735] [8/9 Regression] Bad wrong-code bug with "-march=skylake-avx512 -Ofast"

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86735

--- Comment #13 from janus at gcc dot gnu.org ---
gfortran.fortran-torture/execute/in-pack.f90 in the testsuite exhibits the same
problem as comment 0, I think. It also contains Fortran array operations and
fails with "-march=skylake-avx512 -Ofast". See PR 86831 comment 5.

[Bug c++/86190] [6/7 Regression] -Wsign-conversion ignores explicit conversion in some cases

2018-08-02 Thread TonyELewis at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86190

--- Comment #12 from Tony E Lewis  ---
I confirm that Godbolt's GCC trunk now handles my testcase correctly.

Thanks very much for all work on this.

[Bug target/86803] rx port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86803

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86803, which changed state.

Bug 86803 Summary: rx port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86803

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug middle-end/86827] [8/9 Regression] -Warray-bounds produces negative indicies

2018-08-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-08-02
 Ever confirmed|0   |1

--- Comment #2 from Martin Sebor  ---
Confirmed (gcc-help thread:
https://gcc.gnu.org/ml/gcc-help/2018-08/msg6.html).

[Bug c++/86190] [6/7 Regression] -Wsign-conversion ignores explicit conversion in some cases

2018-08-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86190

--- Comment #13 from Marek Polacek  ---
Thanks for taking the time to report the bug!

[Bug target/86810] v850 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86810

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 15:57:06 2018
New Revision: 263264

URL: https://gcc.gnu.org/viewcvs?rev=263264&root=gcc&view=rev
Log:
PR target/86810
* config/v850/v850.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/v850/v850.c

[Bug middle-end/86660] libgomp.c++/for-15.C ICEs with nvptx offloading

2018-08-02 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

--- Comment #16 from Tom de Vries  ---
Author: vries
Date: Thu Aug  2 15:59:01 2018
New Revision: 263265

URL: https://gcc.gnu.org/viewcvs?rev=263265&root=gcc&view=rev
Log:
[nvptx] Ignore c++ exceptions

The nvptx port can't support exceptions using sjlj, because ptx does not
support sjlj.  However, default_except_unwind_info still returns UI_SJLJ, even
even if we configure with --disable-sjlj-exceptions, because UI_SJLJ is the
fallback option.

The reason default_except_unwind_info doesn't return UI_DWARF2 is because
DWARF2_UNWIND_INFO is not defined in defaults.h, because
INCOMING_RETURN_ADDR_RTX is not defined, because there's no ptx equivalent.

Testcase libgomp.c++/for-15.C currently doesn't compile unless fno-exceptions
is added because:
- it tries to generate sjlj exception handling code, and
- it tries to generate exception tables using label-addressed .byte sequence.
  Ptx doesn't support generating random data at a label, nor being able to
  load/write data relative to a label.

This patch fixes the first problem by using UI_TARGET for nvptx.

The second problem is worked around by generating all .byte sequences commented
out.  It would be better to have a narrower workaround, and define
TARGET_ASM_BYTE_OP to "error: .byte unsupported " or some such.

This patch does not enable exceptions for nvptx, it merely allows c++ programs
to run correctly if they do no use exception handling.

Build and reg-tested on x86_64 with nvptx accelerator.

2018-08-02  Tom de Vries  

PR target/86660
* common/config/nvptx/nvptx-common.c (nvptx_except_unwind_info): New
function.  Return UI_TARGET unconditionally.
(TARGET_EXCEPT_UNWIND_INFO): Redefine to nvptx_except_unwind_info.
* config/nvptx/nvptx.c (TARGET_ASM_BYTE_OP): Emit commented out
'.byte'.

* testsuite/libgomp.oacc-c++/routine-1-auto.C: Remove -fno-exceptions.
* testsuite/libgomp.oacc-c++/routine-1-template-auto.C: Same.
* testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C:
Same.
* testsuite/libgomp.oacc-c++/routine-1-template.C: Same.
* testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C: Same.
* testsuite/libgomp.oacc-c-c++-common/routine-1.c: Same.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/common/config/nvptx/nvptx-common.c
trunk/gcc/config/nvptx/nvptx.c
trunk/libgomp/ChangeLog
trunk/libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C
trunk/libgomp/testsuite/libgomp.oacc-c++/routine-1-template-auto.C
   
trunk/libgomp/testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C
trunk/libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C
trunk/libgomp/testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c

[Bug target/86810] v850 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86810

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86810, which changed state.

Bug 86810 Summary: v850 port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86810

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug target/86813] xstormy16 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86813

--- Comment #1 from Nick Clifton  ---
Author: nickc
Date: Thu Aug  2 16:13:32 2018
New Revision: 263266

URL: https://gcc.gnu.org/viewcvs?rev=263266&root=gcc&view=rev
Log:
PR target/86813
* config/stormy16/stormy16.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/stormy16/stormy16.c

[Bug target/86772] [meta-bug] tracking port status for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86772
Bug 86772 depends on bug 86813, which changed state.

Bug 86813 Summary: xstormy16 port needs updating for CVE-2017-5753
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86813

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug target/86813] xstormy16 port needs updating for CVE-2017-5753

2018-08-02 Thread nickc at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86813

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Clifton  ---
I have defined TARGET_HAVE_SPECULATION_SAFE_VALUE as
speculation_safe_value_not_needed.

[Bug tree-optimization/86702] [9 Regression] SPEC CPU2006 400.perlbench, CPU2017 500.perlbench_r ~3% performance drop after r262247

2018-08-02 Thread alexander.nesterovskiy at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86702

--- Comment #4 from Alexander Nesterovskiy  ---
I've noticed performance regressions on different targets and with different
compilation options, not only highly optimized like "-march=skylake-avx512
-Ofast -flto -funroll-loops" but with "-O2" too.
The simplest case is 500.perlbench_r with "-O2" on Broadwell executed in one
copy.

Performance drop is not in a particular place but "spread" over whole
S_regmatch function which is really big.
My guess was that loosing of these probabilities affects passes that follows
tree-switchlower1.
And it is what I see in generated assembly - some different spilling/filling
and different order of blocks.

[Bug tree-optimization/86552] missing warning for reading past the end of non-string arrays

2018-08-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86552

--- Comment #5 from Martin Sebor  ---
Yes, that's also (partly) why I submitted a solution for pr71625 comment 15:

  https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01884.html

With that patch applied as well the strlen call is diagnosed.

[Bug c/86832] New: GCC v8.2.0 tries to use native TLS with -fstack-protector-strong on Windows (mingw-w64)

2018-08-02 Thread johannes.schindelin at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86832

Bug ID: 86832
   Summary: GCC v8.2.0 tries to use native TLS with
-fstack-protector-strong on Windows (mingw-w64)
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: johannes.schindelin at gmx dot de
  Target Milestone: ---

When I try to compile this program:

-- snip --
static void a1(void *p) { }

int main(int argc, char **argv) {
int i;
a1(&i);
return 0;
}
-- snap --

using

gcc -o a1.o -c -fstack-protector-strong a1.c
gcc -fstack-protector-strong -o a1.exe a1.o

the resulting a1.exe causes a segmentation fault in `main()`. The offending
assembler instruction is this:

0x40156f : mov %fs:0x0,%rax

The good mingw-w64 people pointed out that this looks like native TLS, but
mingw-w64 only supports emulated TLS.

When compiling without -fstack-protector-strong, everything works.

Output of `gcc -v`:

Using built-in specs.
COLLECT_GCC=C:\git-sdk-64-ci\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/git-sdk-64-ci/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-8.2.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=ada,c,lto,c++,objc,obj-c++,fortran
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64
--with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64
--with-pkgversion='Rev1, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld
Thread model: posix
gcc version 8.2.0 (Rev1, Built by MSYS2 project)

[Bug c++/80744] Detect Divide By Zero and give a warning in C/C++

2018-08-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80744

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #3 from Martin Sebor  ---
I agree that diagnosing (A) or (C) under -Wdiv-by-zero would not be appropriate
because the option controls compile-time division by zero and there is none
here.

Extending -Wdiv-by-zero to diagnose possible division by zero would undoubtedly
make the option exceedingly noisy.  Introducing a new option such as
-Wmaybe-div-by-zero analogous to -Wmaybe-uninitialized would be fine but the
option wouldn't diagnose ether (A) or (C) because there is no evidence of
overflow.  -Wmaybe-uninitialized triggers under very restrictive conditions,
when there is some evidence that an uninitialized variable is used.  To avoid
excessive noise from -Wmaybe-div-by-zero some similar approach would need to
used.  Such as:

  int f (int i)
  {
int j;

if (i == 0) // because of this test
  j = 7;
else
  j = 13;

return j / i;   // i may be assumed to be zero here
  }

[Bug target/86828] [6/7 Regression] wrong-code bug with "-march=knl -Ofast" (invalid memory reference)

2018-08-02 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86828

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to H.J. Lu from comment #3)
> I can't reproduce it with gcc version 7.3.1 20180609.

Just made a fresh build off today's 7-branch:

gcc version 7.3.1 20180802 [gcc-7-branch revision 263263] (GCC)

With this I see the same segfault as with the 7.3.0 version provided by Ubuntu
18.04.

Both '-march=knl' and '-march=skylake-avx512' trigger the error in my tests
(when combined with -Ofast).


CPU is Core(TM) i9-7980XE, OS is Ubuntu 18.04. What's yours H.J.?

[Bug libgcc/86512] Incorrect sub result for float subnormal inputs in armv7(with -msoft-float).

2018-08-02 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86512

--- Comment #1 from Richard Earnshaw  ---
Author: rearnsha
Date: Thu Aug  2 16:50:07 2018
New Revision: 263267

URL: https://gcc.gnu.org/viewcvs?rev=263267&root=gcc&view=rev
Log:
arm - correctly handle denormal results during softfp subtraction

2018-08-02  Nicolas Pitre 

PR libgcc/86512
* config/arm/ieee754-df.S (adddf3): Don't shortcut denormal handling
when exponent goes negative. Update my email address.
* config/arm/ieee754-sf.S (addsf3): Likewise.


Modified:
trunk/libgcc/ChangeLog
trunk/libgcc/config/arm/ieee754-df.S
trunk/libgcc/config/arm/ieee754-sf.S

[Bug libgcc/86512] Incorrect sub result for float subnormal inputs in armv7(with -msoft-float).

2018-08-02 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86512

Richard Earnshaw  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Richard Earnshaw  ---
fixed on trunk.

[Bug libgcc/86512] Incorrect sub result for float subnormal inputs in armv7(with -msoft-float).

2018-08-02 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86512

Richard Earnshaw  changed:

   What|Removed |Added

   Target Milestone|--- |9.0

[Bug c++/80744] Detect Divide By Zero and give a warning in C/C++

2018-08-02 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80744

--- Comment #4 from Jonny Grant  ---
Hi Martin
Thank you for your reply.

I appreciate that GCC isn't a static analyser


But I think (C) is probably easier to follow though if GCC was extended, and
(A) std::string harder, as needs knowledge of that container... the static
instrumented code would need to call mystring.size() and see what the value
would be?

int main()
{
std::string empty;
test_func(0, empty)
}

I've attached a test case where (B) is not detected, because "const" is
removed.

[Bug c++/81239] std::__cxx11::string& visible in gcc warning output

2018-08-02 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239

--- Comment #2 from Jonny Grant  ---
Created attachment 44492
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44492&action=edit
Better test case

[Bug c++/81239] std::__cxx11::string& visible in gcc warning output

2018-08-02 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239

--- Comment #3 from Jonny Grant  ---
(In reply to Jonny Grant from comment #2)
> Created attachment 44492 [details]
> Better test case

wrong ticket. please ignore

[Bug c++/80744] Detect Divide By Zero and give a warning in C/C++

2018-08-02 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80744

--- Comment #5 from Jonny Grant  ---
Created attachment 44493
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44493&action=edit
Better test case

[Bug target/86820] [8 regression] gcc-8 miscompiles binutils on m68k

2018-08-02 Thread schwab at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86820

--- Comment #5 from Andreas Schwab  ---
Author: schwab
Date: Thu Aug  2 17:23:13 2018
New Revision: 263269

URL: https://gcc.gnu.org/viewcvs?rev=263269&root=gcc&view=rev
Log:
Fix invalid cc_status after [const_][us]mulsi3_highpart

Backport from mainline
PR target/86820
* config/m68k/m68k.md (umulsi3_highpart+1, const_umulsi3_highpart)
(smulsi3_highpart+1, const_smulsi3_highpart): Add CC_STATUS_INIT.

testsuite/:
PR target/86820
* gcc.target/m68k/mulsi_highpart.c: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gcc.target/m68k/mulsi_highpart.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/config/m68k/m68k.md
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug target/86820] [8 regression] gcc-8 miscompiles binutils on m68k

2018-08-02 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86820

Andreas Schwab  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Andreas Schwab  ---
Fixed.

[Bug target/86784] H8 port needs updating for CVE-2017-5753

2018-08-02 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86784

--- Comment #1 from Jeffrey A. Law  ---
Author: law
Date: Thu Aug  2 17:24:59 2018
New Revision: 263270

URL: https://gcc.gnu.org/viewcvs?rev=263270&root=gcc&view=rev
Log:
PR target/86784
* config/h8300/h8300.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/h8300/h8300.c

  1   2   >