[Bug fortran/69524] [6 Regression] [F08] Compiler segfaults on "module subroutine"

2016-03-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69524

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||law at redhat dot com

[Bug fortran/69603] [5/6 Regression] ICE: segfault with -fimplicit-none and proc_ptr_comp_24.f90

2016-03-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69603

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||law at redhat dot com

[Bug ipa/70188] [4.9/5/6 Regression] gcc 4.9+ miscompiles code on hppa

2016-03-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70188

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #7 from Jeffrey A. Law  ---
Unlikely related to 69532 -- the PA port is consistent WRT PROMOTE_MODE and
friends IIRC.

I'm leaving as P3 until we have this better analyzed though.

[Bug tree-optimization/69728] [6 Regression] internal compiler error: in outer_projection_mupa, at graphite-sese-to-poly.c:1175

2016-03-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69728

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||law at redhat dot com

[Bug middle-end/70199] [5/6 Regression] Crash at -O2 when using labels.

2016-03-14 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70199

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||law at redhat dot com

--- Comment #4 from Jeffrey A. Law  ---
Looks like reload writes offsets_known_at for a label on the
forced_labels_list.  The problem is the label # of the offending label is 0,
but FIRST_LABEL_NUM is 4.  This causes the out-of-bounds array accesses and
ultimately heap corruption.

[Bug middle-end/70219] [6 Regression] ICE: in delete_move_and_clobber, at lra-constraints.c:5864 with -O2

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70219

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 CC||jakub at gcc dot gnu.org
  Component|rtl-optimization|middle-end
 Ever confirmed|0   |1

[Bug middle-end/70219] [6 Regression] ICE: in delete_move_and_clobber, at lra-constraints.c:5864 with -O2

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70219

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 37953
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37953&action=edit
gcc6-pr70219.patch

Untested fix.  The code had assertion dregno > 0, but I don't see anything
special on register 0 (%rax on x86_64), assuming Vlad meant >= 0 here (i.e.
make sure dregno is not negative, which is not a hard register, but has special
meaning).

[Bug middle-end/70219] [6 Regression] ICE: in delete_move_and_clobber, at lra-constraints.c:5864 with -O2

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70219

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/70218] [5/6 Regression] Illegal access to private fields succeeds with 5/6

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70218

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
Started with r216260 fix.

[Bug c++/70204] [6 Regression] ICE on x86_64-linux-gnu in non_const_var_error, at cp/constexpr.c:2764

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70204

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Started with r231197.

[Bug c++/68722] [4.9/5/6 Regression] internal compiler error: in merge_exception_specifiers, at cp/typeck2.c:2108

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68722

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 CC||jakub at gcc dot gnu.org,
   ||paolo at gcc dot gnu.org
   Target Milestone|--- |4.9.4
Summary|internal compiler error: in |[4.9/5/6 Regression]
   |merge_exception_specifiers, |internal compiler error: in
   |at cp/typeck2.c:2108|merge_exception_specifiers,
   ||at cp/typeck2.c:2108
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r204818.

[Bug rtl-optimization/38644] [4.6 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code

2016-03-14 Thread satishbmsce at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644

Satish M  changed:

   What|Removed |Added

 CC||satishbmsce at gmail dot com

--- Comment #72 from Satish M  ---
This bug still exists in GCC 4.8.2 ARM. It can reproduced by adding one more
argument in 'doStreamReadBlock' function in test case.

/x86_64-unknown-linux-gnu/bin/gcc -B /x86_64-unknown-linux-gnu/bin -msoft-float
-marm -mcpu=cortex-a9 -march=armv7-a -mno-thumb-interwork -mlong-calls
-mno-unaligned-access -O2 test.c

extern int doStreamReadBlock (int *, char *, int size, int, int);

char readStream (int *s)
{
   char c = 0;
   doStreamReadBlock (s, &c, 1, *s, 22);
   return c;
}

 :
   0:   e1a0c00dmov ip, sp
   4:   e3a02000mov r2, #0
   8:   e92dd800push{fp, ip, lr, pc}
   c:   e24cb004sub fp, ip, #4
  10:   e24dd008sub sp, sp, #8
  14:   e24b100csub r1, fp, #12
  18:   e3a0c016mov ip, #22
  1c:   e5612001strbr2, [r1, #-1]!
  20:   e3a02001mov r2, #1
  24:   e5903000ldr r3, [r0]
  28:   e58dc000str ip, [sp]
  2c:   e59fc00cldr ip, [pc, #12]   ; 40 
  30:   e12fff3cblx ip
  34:   e24bd00csub sp, fp, #12< Stack frame
de-allocated
  38:   e55b000dldrbr0, [fp, #-13] < Accessing stack.
  3c:   e89da800ldm sp, {fp, sp, pc}
  40:   andeq   r0, r0, r0

[Bug c++/68475] [4.9/5/6 Regression] ICE: in merge_exception_specifiers, at cp/typeck2.c:2115 with -fno-exceptions on invalid code

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68475

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||ice-checking
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |4.9.4
Summary|ICE: in |[4.9/5/6 Regression] ICE:
   |merge_exception_specifiers, |in
   |at cp/typeck2.c:2115 with   |merge_exception_specifiers,
   |-fno-exceptions on invalid  |at cp/typeck2.c:2115 with
   |code|-fno-exceptions on invalid
   ||code

--- Comment #1 from Jakub Jelinek  ---
Started with r175073, the ICE is in gcc_checking_assert that has been added in
that revision.

[Bug tree-optimization/70171] Poor code generated when return struct using ternary operator

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70171

--- Comment #8 from Richard Biener  ---
(In reply to Oleg Endo from comment #7)
> Is this a dup of PR 56365?  Sounds like so ...

No, not really.

[Bug c++/68723] [4.9/5/6 Regression] ice in pop_nested_namespace, at cp/name-lookup.c:3816

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68723

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |4.9.4
Summary|ice in  |[4.9/5/6 Regression] ice in
   |pop_nested_namespace, at|pop_nested_namespace, at
   |cp/name-lookup.c:3816   |cp/name-lookup.c:3816

--- Comment #1 from Jakub Jelinek  ---
Started with r158075.

[Bug c++/68724] [4.9/5/6 Regression] ice in unify, at cp/pt.c:19902

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68724

Jakub Jelinek  changed:

   What|Removed |Added

 CC||froydnj at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |4.9.4
Summary|ice in unify, at|[4.9/5/6 Regression] ice in
   |cp/pt.c:19902   |unify, at cp/pt.c:19902

--- Comment #1 from Jakub Jelinek  ---
Started with r166977.

[Bug c++/68728] [6 Regression] ice: unexpected expression ‘(const char*)__s’ of kind implicit_conv_expr

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68728

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||error-recovery
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |6.0
Summary|ice: unexpected expression  |[6 Regression] ice:
   |‘(const char*)__s’ of kind  |unexpected expression
   |implicit_conv_expr  |‘(const char*)__s’ of kind
   ||implicit_conv_expr

--- Comment #2 from Jakub Jelinek  ---
Started with r230365.

[Bug tree-optimization/70221] New: graph dump flag used for constraint graph in points-to analysis

2016-03-14 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70221

Bug ID: 70221
   Summary: graph dump flag used for constraint graph in points-to
analysis
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: trivial
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

At the documentation for 'fdump-tree-switch' here
(https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html ) we read:
...
‘graph’
For each of the other indicated dump files (-fdump-rtl-pass), dump a
representation of the control flow graph suitable for viewing with GraphViz to
file.passid.pass.dot. Each function in the file is pretty-printed as a
subgraph, so that GraphViz can render them all in a single plot.

This option currently only works for RTL dumps, and the RTL is always
dumped in slim form. 
...

However, also tree-ssa-structalias.c uses TDF_GRAPH, to decide whether to dump
various constraint graphs:
...
$ grep -d skip TDF_GRAPH gcc/* | grep -v ChangeLog
gcc/dumpfile.c:  {"graph", TDF_GRAPH},
gcc/dumpfile.c: | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
gcc/dumpfile.h:#define TDF_GRAPH(1 << 13)   /* a graph dump is
being emitted */
gcc/passes.c:   && (dfi->pflags & TDF_GRAPH) != 0
gcc/passes.c: && (dump_flags & TDF_GRAPH))
gcc/passes.c: && dump_file && (dump_flags & TDF_GRAPH)
gcc/tree-ssa-structalias.c:  if (dump_file && (dump_flags & TDF_GRAPH))
gcc/tree-ssa-structalias.c:  if (dump_file && (dump_flags & TDF_GRAPH))
gcc/tree-ssa-structalias.c:  if (dump_file && (dump_flags & TDF_GRAPH))
...

These constraint graphs are dump into the normal dump file, and can be
extracted with scripts like this:
...
$ cat split.sh
#!/bin/sh

file="test.c.079i.pta2"

cat "$file" | awk -f split.awk 

$ cat split.awk
BEGIN {
n=0
outfile=sprintf("file%02d.dot",n)
doprint=0
}
/^\/\/ The constraint graph/{
doprint=1
}

{
if (doprint)
print > outfile
}

/^}/{
n=n+1
outfile=sprintf("file%02d.dot",n)
doprint=0
}
...

It would be good if the graphs were emitted into separate file(s).

And the constraint graph does not match the description of the 'graph' flag
semantics, so it's probably better to have it triggered by something else, say
TDF_DETAILS.

[Bug c++/70222] New: Test miscompiled with -O1

2016-03-14 Thread vsevolod.livinskij at frtk dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

Bug ID: 70222
   Summary: Test miscompiled with -O1
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

Created attachment 37954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37954&action=edit
Reproducer.

Test case produces incorrect result starting with -O1 optimization level. Test
case fails with -march=nehalem, haswell, knl and skylake-avx512 options and
with gcc version 4.8.5 (Revision=226194), gcc version 4.9.4 20160311
(prerelease) (Revision=234148) and gcc version 5.3.1 20160311
(Revision=234148).

Output:
>  g++ repr.cpp -o out -O1 -march=haswell; ./out
-262143
>  g++ repr.cpp -o out -O0 -march=haswell; ./out
-1

GCC version:
> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/export/users/vlivinsk/gcc-trunk/bin/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /export/users/vlivinsk/gcc-trunk/gcc/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse --enable-checking=release --enable-languages=c,c++,lto
--with-gmp=/export/users/vlivinsk/gcc-trunk/gmp-6.1.0/bin
--with-mpfr=/export/users/vlivinsk/gcc-trunk/mpfr-3.1.3/bin
--with-mpc=/export/users/vlivinsk/gcc-trunk/mpc-1.0.3/bin
--prefix=/export/users/vlivinsk/gcc-trunk/bin
Thread model: posix
gcc version 6.0.0 20160314 (experimental) (Revision=234175)

[Bug tree-optimization/70221] graph dump flag used for constraint graph in points-to analysis

2016-03-14 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70221

vries at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P5

[Bug c++/68728] [6 Regression] ice: unexpected expression ‘(const char*)__s’ of kind implicit_conv_expr

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68728

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jakub Jelinek  ---
Ah, but the error-recovery bug got fixed with r232438.

[Bug tree-optimization/70045] [6 Regression] ICE error: mismatching comparison operand types

2016-03-14 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70045

--- Comment #4 from vries at gcc dot gnu.org ---
Author: vries
Date: Mon Mar 14 09:19:14 2016
New Revision: 234177

URL: https://gcc.gnu.org/viewcvs?rev=234177&root=gcc&view=rev
Log:
Unshare create_empty_if_region_on_edge argument

2016-03-14  Tom de Vries  

PR tree-optimization/70045
* graphite-isl-ast-to-gimple.c (graphite_create_new_loop_guard):
Unshare
create_empty_if_region_on_edge argument.

* gcc.dg/graphite/pr70045.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/graphite/pr70045.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/graphite-isl-ast-to-gimple.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/70045] [6 Regression] ICE error: mismatching comparison operand types

2016-03-14 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70045

vries at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |vries at gcc dot gnu.org

--- Comment #5 from vries at gcc dot gnu.org ---
patch with test-case committed, marking resolved-fixed.

[Bug fortran/45076] [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use

2016-03-14 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45076

--- Comment #10 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Mon Mar 14 09:21:32 2016
New Revision: 234178

URL: https://gcc.gnu.org/viewcvs?rev=234178&root=gcc&view=rev
Log:
2016-03-13  Dominique d'Humieres  

PR fortran/45076
gfortran.dg/prof/prof.exp: New script.
gfortran.dg/prof/dynamic_dispatch_6.f03: New test.


Added:
branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/
   
branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/prof/prof.exp
Modified:
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog

[Bug libstdc++/69782] [6 Regression] defining min() macro causes thousand of lines of error messages

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69782

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
So is the plan to uglify all
find libstdc++-v3/include -type f | xargs grep '[^a-zA-Z_]\(min\|max\)(' | wc
-l
461
with ()s around min/max or whatever id-expression it appears at the end of?
For 6.x or just 7.x?

[Bug c++/70178] Loop-invariant memory loads from std::string innards are not hoisted

2016-03-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70178

--- Comment #4 from Jonathan Wakely  ---
There is no 'restrict' keyword in ISO C++ and no equivalent language feature.

I think it would be OK to use __restrict__ on the _M_dataplus._M_p member.

[Bug tree-optimization/56365] Missed opportunities for smin/smax standard name patterns when compiling as C++

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #7 from Richard Biener  ---
Ok, so let me fix this for GCC 7.  It isn't realy "phi merging" but
phiopt being confused by our a <= -128 to a < -127 canonicalization.

[Bug fortran/45076] [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45076

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Dominique d'Humieres  ---
Test committed to the trunk and the gcc 4.9 and 5 branches. Closing as FIXED.

[Bug tree-optimization/69951] wrong code at -O1 and above on x86_64-linux-gnu

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69951

--- Comment #6 from Richard Biener  ---
Seems I typoed the PR reference in the commit:

Author: rguenth
Date: Fri Feb 26 08:34:58 2016
New Revision: 233734

URL: https://gcc.gnu.org/viewcvs?rev=233734&root=gcc&view=rev
Log:
2016-02-26  Richard Biener  

PR tree-optimization/69551
* tree-ssa-structalias.c (get_constraint_for_ssa_var): When
looking through aliases adjust DECL_PT_UID to refer to the
ultimate alias target.

* gcc.dg/torture/pr69951.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr69951.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-structalias.c

[Bug rtl-optimization/38644] [4.6 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644

--- Comment #73 from Richard Biener  ---
(In reply to Satish M from comment #72)
> This bug still exists in GCC 4.8.2 ARM. It can reproduced by adding one more
> argument in 'doStreamReadBlock' function in test case.
> 
> /x86_64-unknown-linux-gnu/bin/gcc -B /x86_64-unknown-linux-gnu/bin
> -msoft-float -marm -mcpu=cortex-a9 -march=armv7-a -mno-thumb-interwork
> -mlong-calls -mno-unaligned-access -O2 test.c
> 
> extern int doStreamReadBlock (int *, char *, int size, int, int);
> 
> char readStream (int *s)
> {
>char c = 0;
>doStreamReadBlock (s, &c, 1, *s, 22);
>return c;
> }
> 
>  :
>0: e1a0c00dmov ip, sp
>4: e3a02000mov r2, #0
>8: e92dd800push{fp, ip, lr, pc}
>c: e24cb004sub fp, ip, #4
>   10: e24dd008sub sp, sp, #8
>   14: e24b100csub r1, fp, #12
>   18: e3a0c016mov ip, #22
>   1c: e5612001strbr2, [r1, #-1]!
>   20: e3a02001mov r2, #1
>   24: e5903000ldr r3, [r0]
>   28: e58dc000str ip, [sp]
>   2c: e59fc00cldr ip, [pc, #12]   ; 40 
>   30: e12fff3cblx ip
>   34: e24bd00csub sp, fp, #12< Stack frame 
> de-allocated
>   38: e55b000dldrbr0, [fp, #-13] < Accessing stack.
>   3c: e89da800ldm sp, {fp, sp, pc}
>   40: andeq   r0, r0, r0

Please open a new bugreport.

[Bug tree-optimization/69951] wrong code at -O1 and above on x86_64-linux-gnu

2016-03-14 Thread chengniansun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69951

--- Comment #7 from Chengnian Sun  ---
(In reply to Richard Biener from comment #6)
> Seems I typoed the PR reference in the commit:
> 
> Author: rguenth
> Date: Fri Feb 26 08:34:58 2016
> New Revision: 233734
> 
> URL: https://gcc.gnu.org/viewcvs?rev=233734&root=gcc&view=rev
> Log:
> 2016-02-26  Richard Biener  
> 
>   PR tree-optimization/69551
>   * tree-ssa-structalias.c (get_constraint_for_ssa_var): When
>   looking through aliases adjust DECL_PT_UID to refer to the
>   ultimate alias target.
> 
>   * gcc.dg/torture/pr69951.c: New testcase.
> 
> Added:
> trunk/gcc/testsuite/gcc.dg/torture/pr69951.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/testsuite/ChangeLog
> trunk/gcc/tree-ssa-structalias.c

Thank you so much, Richard.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-03-14 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

vehre at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #16 from vehre at gcc dot gnu.org ---
No complaints so far, closing.

[Bug fortran/52673] implement -fheap-arrays in gfortran

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52673

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #3 from Dominique d'Humieres  ---
> This PR has not evolved since three years and a half and now new options
> are available to catch such issues. IMO This PR should be closed as WONTFIX.

No feedback, closing.

[Bug libstdc++/69782] [6 Regression] defining min() macro causes thousand of lines of error messages

2016-03-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69782

--- Comment #8 from Jonathan Wakely  ---
(In reply to Jakub Jelinek from comment #7)
> So is the plan to uglify all
> find libstdc++-v3/include -type f | xargs grep '[^a-zA-Z_]\(min\|max\)(' |
> wc -l
> 461
> with ()s around min/max or whatever id-expression it appears at the end of?

I started doing that, and it made me want to hit myself in the face with a
hammer.

Adding a header that #undefs the macros and including it everywhere necessary
is a much smaller patch, and doesn't obfuscate hundreds of valid uses of
min/max functions in the library. It also means users can call the std min/max
functions without parentheses because any macros have been removed. It doesn't
allow people to continue using their undefined macros, but those people are
immoral anyway.

> For 6.x or just 7.x?

I find it hard to care about code with min/max macros.

[Bug libstdc++/69782] [6/7 Regression] defining min() macro causes thousand of lines of error messages

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69782

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|6.0 |7.0
Summary|[6 Regression] defining |[6/7 Regression] defining
   |min() macro causes thousand |min() macro causes thousand
   |of lines of error messages  |of lines of error messages

--- Comment #9 from Jakub Jelinek  ---
Retargetting at GCC 7 then, feel free to close as NOTABUG if you don't want to
do anything.

[Bug target/62281] gcc doesn't conform to Solaris 32-bit ABI by expecting 16-byte stack alignment

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62281

--- Comment #15 from Rainer Orth  ---
Author: ro
Date: Mon Mar 14 09:56:47 2016
New Revision: 234179

URL: https://gcc.gnu.org/viewcvs?rev=234179&root=gcc&view=rev
Log:
Only assume 4-byte stack alignment on Solaris/x86 (PR target/62281)

Backport from mainline
2016-03-07  Rainer Orth  

PR target/62281
* config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define.

Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/i386/sol2.h

[Bug fortran/38979] OpenMP extension: THREADPRIVATE for EQUIVALENCEd symbols

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38979

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #12 from Dominique d'Humieres  ---
> Any progress after six years?

PING!

[Bug target/62281] gcc doesn't conform to Solaris 32-bit ABI by expecting 16-byte stack alignment

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62281

--- Comment #16 from Rainer Orth  ---
Author: ro
Date: Mon Mar 14 10:03:12 2016
New Revision: 234180

URL: https://gcc.gnu.org/viewcvs?rev=234180&root=gcc&view=rev
Log:
Only assume 4-byte stack alignment on Solaris/x86 (PR target/62281)

Backport from mainline:
2016-03-07  Rainer Orth  

PR target/62281
* config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define.

Revert:
2014-02-11  Rainer Orth  

PR libgomp/60107
* config/i386/sol2-9.h: New file.
* config.gcc (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*,
*-*-solaris2.9*): Use it.

Removed:
branches/gcc-4_9-branch/gcc/config/i386/sol2-9.h
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config.gcc
branches/gcc-4_9-branch/gcc/config/i386/sol2.h

[Bug libgomp/60107] libgomp.c/pr58392.c etc. FAIL

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60107

--- Comment #8 from Rainer Orth  ---
Author: ro
Date: Mon Mar 14 10:03:12 2016
New Revision: 234180

URL: https://gcc.gnu.org/viewcvs?rev=234180&root=gcc&view=rev
Log:
Only assume 4-byte stack alignment on Solaris/x86 (PR target/62281)

Backport from mainline:
2016-03-07  Rainer Orth  

PR target/62281
* config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define.

Revert:
2014-02-11  Rainer Orth  

PR libgomp/60107
* config/i386/sol2-9.h: New file.
* config.gcc (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*,
*-*-solaris2.9*): Use it.

Removed:
branches/gcc-4_9-branch/gcc/config/i386/sol2-9.h
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config.gcc
branches/gcc-4_9-branch/gcc/config/i386/sol2.h

[Bug target/62281] gcc doesn't conform to Solaris 32-bit ABI by expecting 16-byte stack alignment

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62281

Rainer Orth  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|5.4 |4.9.4

--- Comment #17 from Rainer Orth  ---
Fixed for GCC 4.9.4, 5.4, 6.1.

[Bug c/70223] New: [ARM] Optimization level -O2 results in wrong code

2016-03-14 Thread satishbmsce at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70223

Bug ID: 70223
   Summary: [ARM] Optimization level -O2 results in wrong code
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: satishbmsce at gmail dot com
  Target Milestone: ---

-fschedule-insns2 flag within optimization level -O2 results in wrong code. By
adding one more argument to test function 'doStreamReadBlock' defined in file
'gcc/testsuite/gcc.target/arm/stack-red-zone.c' issue can produced. 

/x86_64-unknown-linux-gnu/bin/gcc -B /x86_64-unknown-linux-gnu/bin -msoft-float
-marm -mcpu=cortex-a9 -march=armv7-a -mno-thumb-interwork -mlong-calls
-mno-unaligned-access -O2 test.c

test.c: 
extern int doStreamReadBlock (int *, char *, int size, int, int);

char readStream (int *s)
{
   char c = 0;
   doStreamReadBlock (s, &c, 1, *s, 22);
   return c;
}

 :
   0:   e1a0c00dmov ip, sp
   4:   e3a02000mov r2, #0
   8:   e92dd800push{fp, ip, lr, pc}
   c:   e24cb004sub fp, ip, #4
  10:   e24dd008sub sp, sp, #8
  14:   e24b100csub r1, fp, #12
  18:   e3a0c016mov ip, #22
  1c:   e5612001strbr2, [r1, #-1]!
  20:   e3a02001mov r2, #1
  24:   e5903000ldr r3, [r0]
  28:   e58dc000str ip, [sp]
  2c:   e59fc00cldr ip, [pc, #12]   ; 40 
  30:   e12fff3cblx ip
  34:   e24bd00csub sp, fp, #12< Stack frame
de-allocated
  38:   e55b000dldrbr0, [fp, #-13] < Accessing stack.
  3c:   e89da800ldm sp, {fp, sp, pc}
  40:   andeq   r0, r0, r0

[Bug middle-end/70199] [5/6 Regression] Crash at -O2 when using labels.

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70199

Richard Biener  changed:

   What|Removed |Added

   Priority|P1  |P2

[Bug tree-optimization/70193] missed loop splitting support based on iteration space

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70193

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 Blocks||53947
 Ever confirmed|0   |1

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


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

[Bug middle-end/70189] Combine constant-pool logic from gimplify + SRA

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70189

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 Ever confirmed|0   |1

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

[Bug rtl-optimization/70224] New: [6 regression] ICE: RTL flag check: CROSSING_JUMP_P used with unexpected rtx code 'insn' in relax_delay_slots, at reorg.c:3310

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70224

Bug ID: 70224
   Summary: [6 regression] ICE: RTL flag check: CROSSING_JUMP_P
used with unexpected rtx code 'insn' in
relax_delay_slots, at reorg.c:3310
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
  Host: sparc*-sun-solaris2.*
Target: sparc*-sun-solaris2.*
 Build: sparc*-sun-solaris2.*

Within the last week, gcc.dg/tree-prof/20041218-1.c started to FAIL for the
64-bit multilib only on Solaris/SPARC:

FAIL: gcc.dg/tree-prof/20041218-1.c compilation,  -fprofile-use -D_PROFILE_USE
(internal compiler error)
UNRESOLVED: gcc.dg/tree-prof/20041218-1.c execution,-fprofile-use
-D_PROFILE_USE

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c: In
function 'foo':^M
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c:110:1:
internal compiler error: RTL flag check: CROSSING_JUMP_P used with unexpected
rtx code 'insn' in relax_delay_slots, at reorg.c:3310^M
0x913433 rtl_check_failed_flag(char const*, rtx_def const*, char const*, int,
char const*)^M
/vol/gcc/src/hg/trunk/local/gcc/rtl.c:878^M
0x90dfcb relax_delay_slots^M
/vol/gcc/src/hg/trunk/local/gcc/reorg.c:3310^M
0x90dfcb dbr_schedule^M
/vol/gcc/src/hg/trunk/local/gcc/reorg.c:3725^M
0x90dfcb rest_of_handle_delay_slots^M
/vol/gcc/src/hg/trunk/local/gcc/reorg.c:3866^M
0x90dfcb execute^M
/vol/gcc/src/hg/trunk/local/gcc/reorg.c:3897^M

  Rainer

[Bug rtl-optimization/70224] [6 regression] ICE: RTL flag check: CROSSING_JUMP_P used with unexpected rtx code 'insn' in relax_delay_slots, at reorg.c:3310

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70224

Rainer Orth  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

[Bug c++/70205] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: tree check: expected tree_binfo, have error_mark in add_candidates, at cp/call.c:5283

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70205

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
  Known to work||4.7.4
   Target Milestone|--- |4.9.4
Summary|ICE on valid code on|[4.9/5/6 Regression] ICE on
   |x86_64-linux-gnu: tree  |valid code on
   |check: expected tree_binfo, |x86_64-linux-gnu: tree
   |have error_mark in  |check: expected tree_binfo,
   |add_candidates, at  |have error_mark in
   |cp/call.c:5283  |add_candidates, at
   ||cp/call.c:5283
  Known to fail||4.8.5

--- Comment #3 from Richard Biener  ---
Works on the 4.7 branch.

[Bug c++/70205] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: tree check: expected tree_binfo, have error_mark in add_candidates, at cp/call.c:5283

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70205

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug sanitizer/70147] testcase from hana testsuite gets miscompiled with -fsanitize=undefined

2016-03-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

--- Comment #6 from Martin Liška  ---
Thank you Jakub for the reduced test-case.
As I've read the source code, current_vtt_parm is
properly defined in start_preparsed_function function.

vtt_parm definition:
/* In a base member initializer, we cannot rely on the
vtable being set up.  We have to indirect via the vtt_parm.  */

So as suggested by Jakub, we have to somehow replace
((struct C *) this)->D.2663.D.2604._vptr.A with read of current_vtt_parm
which can be quite easily passed to cp_ubsan_dfs_initialize_vtbl_ptrs.

Question is how to easily replace these? Should I process a dfs_walk a replace
all occurrences, or is there any easier approach?

Thanks,
Martin

[Bug c++/70201] Dump C++ template instantiations

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70201

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-03-14
 Ever confirmed|0   |1

[Bug c++/70201] Dump C++ template instantiations

2016-03-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70201

--- Comment #1 from Jonathan Wakely  ---
What do you plan to implement?  It would be better to produce output compatible
with Templight (http://plc.inf.elte.hu/templight/) rather than a GCC-specific
dump.

[Bug c++/70222] Test miscompiled with -O1

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 Ever confirmed|0   |1
  Known to fail||4.0.4, 4.1.2, 4.2.4, 4.3.6

--- Comment #1 from Richard Biener  ---
Confirmed.  -O2 is fine again.

void abort (void);

int a = 1;
unsigned int b = 2;
int c = 0;
int d = 0;

void foo () 
{
  int e = ((-(c >= c)) < b) > ((int)(((unsigned long long int)(-1)) >> ((a / a)
* 15)));
  d = -e;
}

int main ()
{
  foo ();
  if (d != -1)
abort ();
  return 0;
}

[Bug rtl-optimization/70222] Test miscompiled with -O1

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

Richard Biener  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org
  Component|c++ |rtl-optimization

--- Comment #2 from Richard Biener  ---
Inlining hides the RTL opt bug.  Disabling RTL combine fixes it.

[Bug rtl-optimization/70224] [6 regression] ICE: RTL flag check: CROSSING_JUMP_P used with unexpected rtx code 'insn' in relax_delay_slots, at reorg.c:3310

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70224

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug rtl-optimization/70223] [ARM] Optimization level -O2 results in wrong code

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70223

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Target||arm*
  Component|c   |rtl-optimization

--- Comment #1 from Richard Biener  ---
Can you please check a still supported compiler version (GCC 4.9.3, GCC 5.3 or
recent trunk)?

[Bug tree-optimization/56365] Missed opportunities for smin/smax standard name patterns when compiling as C++

2016-03-14 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

--- Comment #8 from Oleg Endo  ---
(In reply to Richard Biener from comment #7)
> Ok, so let me fix this for GCC 7.

Thanks :)

[Bug rtl-optimization/70223] [ARM] Optimization level -O2 results in wrong code

2016-03-14 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70223

--- Comment #2 from Ramana Radhakrishnan  ---
The ARM port does not use frame pointers unless specified on the command line
or an actual need in the program (read alloca). 

With 4.8.5 I get with the command line options suggested *and*
-fno-omit-frame-pointer which seems to be missed in the options provided in the
PR, a number of which are completely redundant :

readStream:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd   sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #16
mov lr, #0
sub r1, fp, #4
mov r2, #22
movwip, #:lower16:doStreamReadBlock
ldr r3, [r0]
movtip, #:upper16:doStreamReadBlock
strblr, [r1, #-1]!
str r2, [sp]
mov r2, #1
blx ip
ldrbr0, [fp, #-5]   @ zero_extendqisi2
sub sp, fp, #4
@ sp needed
ldmfd   sp!, {fp, pc}

Not sure what's going on yet, probably worth a bisect / search between versions
of the compiler in the 4.8 tree ... 

Note also that I don't see the problem on the 4.9, 5.X and trunk with the
testcase provided.

[Bug rtl-optimization/70222] Test miscompiled with -O1

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Yeah, it is combine.
First of all, the -1ULL >> (... * 15) is properly optimized into
(insn 12 11 13 2 (set (reg:DI 102)
(const_int 8589934591 [0x1])) pr70222.c:9 85 {*movdi_internal}
 (nil))
but the
(insn 13 12 14 2 (parallel [
(set (reg:SI 104 [ e ])
(lshiftrt:SI (subreg:SI (reg:DI 102) 0)
(const_int 31 [0x1f])))
(clobber (reg:CC 17 flags))
]) pr70222.c:9 562 {*lshrsi3_1}
 (expr_list:REG_DEAD (reg:DI 102)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil
which is supposed to yield 1 or 0 (in this case 1) is mis-simplified into:
(insn 13 12 14 2 (parallel [
(set (subreg:DI (reg:SI 104 [ e ]) 0)
(lshiftrt:DI (reg:DI 102)
(subreg:QI (reg:SI 101) 0)))
(clobber (reg:CC 17 flags))
]) pr70222.c:9 564 {*lshrdi3_1}
 (expr_list:REG_DEAD (reg:SI 101)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 102)
(nil)

[Bug rtl-optimization/70222] Test miscompiled with -O1

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
   Target Milestone|--- |6.0

--- Comment #4 from Jakub Jelinek  ---
Looking at this.

[Bug libfortran/69799] FAIL: gfortran.dg/coarray_allocate_3.f08 at -O1 and above

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69799

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||afanfa at gcc dot gnu.org

--- Comment #3 from Dominique d'Humieres  ---
> Needs to link against -latomic.


Why? Apparently it does not need it on x86_64-apple-darwin15.

What happens if you add '-latomic' to the dg-options list?

[Bug sanitizer/70147] testcase from hana testsuite gets miscompiled with -fsanitize=undefined

2016-03-14 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

--- Comment #7 from Bernd Edlinger  ---
But how about that?


diff -up gcc/cp/cp-ubsan.c.jj gcc/cp/cp-ubsan.c
--- gcc/cp/cp-ubsan.c.jj2016-03-04 23:10:49.0 +0100
+++ gcc/cp/cp-ubsan.c   2016-03-14 12:09:38.730344495 +0100
@@ -283,7 +283,7 @@ cp_ubsan_dfs_initialize_vtbl_ptrs (tree
   if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
 return dfs_skip_bases;

-  if (!BINFO_PRIMARY_P (binfo) || BINFO_VIRTUAL_P (binfo))
+  if (!BINFO_PRIMARY_P (binfo) && !BINFO_VIRTUAL_P (binfo))
 {
   tree base_ptr = TREE_VALUE ((tree) data);




Which does just do the instrumentation on the simple case,
and leaves the virtual base classes alone.
At least the test case from PR70035 does not use virtual base
classes, and will still work.

[Bug target/70117] ppc long double isinf() is wrong?

2016-03-14 Thread normand at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70117

Michel Normand  changed:

   What|Removed |Added

 CC||normand at linux dot 
vnet.ibm.com

--- Comment #8 from Michel Normand  ---
How to make this problem to be solved between gcc and gnulib ?

There is pending discussion in gnulib ML at
http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00032.html

[Bug tree-optimization/56365] [4.9/5/6 Regression] Missed opportunities for smin/smax standard name patterns when compiling as C++

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Priority|P3  |P2
  Known to work||4.3.6
   Target Milestone|--- |4.9.4
Summary|Missed opportunities for|[4.9/5/6 Regression] Missed
   |smin/smax standard name |opportunities for smin/smax
   |patterns when compiling as  |standard name patterns when
   |C++ |compiling as C++
  Known to fail||4.7.3, 5.3.0, 6.0
   Severity|enhancement |normal

--- Comment #9 from Richard Biener  ---
In the following testcase we used to do better with GCC 4.3 at least, handling
test_02 and test_04 completely and test_01 and test_03 half-way.  Compared
to GCC 5 which only handles test_04 completely and test_03 half-way and
test_01 and test_02 not at all.

So this is a regression probably caused by adding maybe_canonicalize_comparison
to comparison folding, PR26899.

int test_01 (int a)
{
  if (127 <= a)
a = 127;
  else if (a <= -128)
a = -128;
  return a;
}
int test_02 (int a)
{
  if (127 < a)
a = 127;
  else if (a <= -128)
a = -128;
  return a;
}
int test_03 (int a)
{
  if (127 <= a)
a = 127;
  else if (a < -128)
a = -128;
  return a;
}
int test_04 (int a)
{
  if (127 < a)
a = 127;
  else if (a < -128)
a = -128;
  return a;
}

[Bug c++/68732] Internal error while compiling CLRadeonExtender

2016-03-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68732

Marek Polacek  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #6 from Marek Polacek  ---
Feedback not coming.

[Bug c++/70209] [5/6 Regression] ICE in strip_typedefs, at cp/tree.c:1377

2016-03-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70209

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Starting with r233715 I see the ICE, before that:

$ ./cc1plus.233714 -quiet ~/w.cc
/home/brq/mpolacek/w.cc: In member function ‘void A< 
>::m_fn2(Vector&, Vector&, Vector&, Vector&, Vector&) const [with
 = int]’:
/home/brq/mpolacek/w.cc:14:16: error: expected ‘;’ at end of input
 p5.m_fn1(m_data)
^
/home/brq/mpolacek/w.cc:14:16: error: expected ‘}’ at end of input

[Bug c++/70209] [5/6 Regression] ICE in strip_typedefs, at cp/tree.c:1377

2016-03-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70209

--- Comment #2 from Marek Polacek  ---
So the testcase seem to be incomplete.

[Bug c++/70209] [5/6 Regression] ICE in strip_typedefs, at cp/tree.c:1377

2016-03-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70209

--- Comment #3 from Markus Trippelsdorf  ---
(In reply to Marek Polacek from comment #2)
> So the testcase seem to be incomplete.

Sure. It needs an additional "};".

[Bug c++/70201] Dump C++ template instantiations

2016-03-14 Thread daniel.gutson at tallertechnologies dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70201

--- Comment #2 from Daniel Gutson  
---
(In reply to Jonathan Wakely from comment #1)
> What do you plan to implement?  It would be better to produce output
> compatible with Templight (http://plc.inf.elte.hu/templight/) rather than a
> GCC-specific dump.

Actually I planned to implement the human-friendly format that gcc currently
outputs when an instantiation fails [with T=...], which I think it will be
useful for most users; however I admit that hving templight support is
interesting.
So I propose to implement
   -fdump-template-instantations=human
or alike, leaving the code cleanly ready to add other dump formats (such as
=templight) or =plugin to enable user-defined dump formats (so templight could
be implemented as one).
What do you think?

[Bug c++/70194] [6 regression] missing -Waddress on constexpr pointer

2016-03-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70194

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek  ---
Started since delayed folding, r230365.

[Bug testsuite/68232] gcc.dg/ifcvt-4.c fails on some arm configurations

2016-03-14 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68232

--- Comment #8 from James Greenhalgh  ---
(In reply to Pat Haugen from comment #6)
> (In reply to James Greenhalgh from comment #5)
> > "Fixed" with the testsuite skips. Feel free to add any other target triplets
> > for which this test is unreliable.
> 
> I was going to modify the powerpc64le triplet to just powerpc*-*-* since it
> also fails for powerpc64 (big endian) and powerpc-ibm-aix, but looking at
> gcc/config/rs6000/rs6000.h, it has BRANCH_COST defined to a non-zero value:
> 
> #define BRANCH_COST(speed_p, predictable_p) 3
> 
> 
> So there must be something more than just "doesn't work for targets with
> branch cost == 0". I'm still happy to make the change if there are other
> reasons, but didn't want to do so without hearing first.

Sorry that I took a while to get round to looking at this.

For powerpc64 you'll need to enable conditional move instructions using
"-misel" (or equivalent) for this test to pass.

For hppa64, the "experimental" movdicc pattern has this restriction:

  if (GET_MODE (XEXP (operands[1], 0)) != DImode
 || GET_MODE (XEXP (operands[1], 0)) != GET_MODE (XEXP (operands[1], 1)))

But, we're trying to expand with this comparison in operands[1]:

  (le (subreg/s/u:SI (reg/v:DI 70 [ x+-4 ]) 4)
  (subreg/s/u:SI (reg/v:DI 71 [ y+-4 ]) 4))

so this test fails, and we fail to ifcvt the sequence. The test should be
skipped on hppa64 until more complete support for conditional moves is added.

[Bug c++/70201] Dump C++ template instantiations

2016-03-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70201

Jonathan Wakely  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely  ---
As long as it doesn't make Templight output any more difficult I have no
objections :-)

I don't know if Jason already started looking at what would be needed for
Templight output, but he might have some suggestions.

[Bug libfortran/69799] FAIL: gfortran.dg/coarray_allocate_3.f08 at -O1 and above

2016-03-14 Thread dave.anglin at bell dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69799

--- Comment #4 from dave.anglin at bell dot net ---
On 2016-03-14, at 7:17 AM, dominiq at lps dot ens.fr wrote:

>> Needs to link against -latomic.
> 
> 
> Why? Apparently it does not need it on x86_64-apple-darwin15.

x86_64 has atomic support fully implemented in header.  Some targets like hppa
have code in libatomic which calls kernel helpers, etc.

> 
> What happens if you add '-latomic' to the dg-options list?

It passes.

Dave
--
John David Anglin   dave.ang...@bell.net

[Bug fortran/56440] Compiler crash for f90 with C-binded subroutine name, which is equals to module name

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56440

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Dominique d'Humieres  ---
It looks like a duplicate of pr53478.

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

[Bug fortran/53478] gfortran segfaults when module name clashes with C binding name of procedure

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53478

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||kapojko at yandex dot ru

--- Comment #7 from Dominique d'Humieres  ---
*** Bug 56440 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/70222] Test miscompiled with -O1

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

--- Comment #5 from Jakub Jelinek  ---
So, the bug is apparently in simplify_shift_const_1 (code=LSHIFTRT,
result_mode=SImode, varop=0x7184de70, orig_count=31)
where varop is:
(subreg:SI (lshiftrt:DI (const_int -1 [0x])
(subreg:QI (reg:SI 100) 0)) 0)
We optimize the inner shift (mode == DImode) into
(lshiftrt:DI (const_int 8589934591 [0x1])
(subreg:QI (reg:SI 100) 0)) 0)
which is fine (assuming we do the final masking), and turn shift count into 0. 
shift_mode is still SImode, because nonzero_bits doesn't say the upper bits are
0, and we don't have OUTER_OP.  For this to really work, we need to mask off
the bits though.

We have:

  /* If we were doing an LSHIFTRT in a wider mode than it was originally,  
 turn off all the bits that the shift would have turned off.  */
  if (orig_code == LSHIFTRT && result_mode != shift_mode)
x = simplify_and_const_int (NULL_RTX, shift_mode, x,
GET_MODE_MASK (result_mode) >> orig_count);

that does this, unfortunately it doesn't trigger here, because shift_mode ==
result_mode == SImode.

So, one possibility is to do
  if (orig_code == LSHIFTRT
  && (result_mode != shift_mode
  || (result_mode != mode && count == 0)))
(and maybe "&& orig_count != 0" too?), to say that we need to mask even if the
shift in shift_mode actually isn't performed at all (or shall it be orig_count
!= count ?).

Or we'd need to force outer_op in this case somewhere, but not sure what all
cases would need to do that.

[Bug target/38239] [4.9, 5, 6 regression] The function mcount in gmon.o changes register ecx

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38239

--- Comment #3 from Rainer Orth  ---
Created attachment 37955
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37955&action=edit
proposed patch

[Bug target/38239] [4.9, 5, 6 regression] The function mcount in gmon.o changes register ecx

2016-03-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38239

Rainer Orth  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-03-14
  Known to work||4.3.2, 4.4.2, 4.5.2, 4.6.0,
   ||4.7.2, 4.8.0
   Assignee|unassigned at gcc dot gnu.org  |ro at gcc dot gnu.org
   Target Milestone|--- |6.0
Summary|The function mcount in  |[4.9, 5, 6 regression] The
   |gmon.o changes register ecx |function mcount in gmon.o
   ||changes register ecx
 Ever confirmed|0   |1
  Known to fail||4.9.0, 5.1.0, 6.0

--- Comment #2 from Rainer Orth  ---
I can now reproduce this, starting with gcc 4.9.

After some digging, I found that _mcount isn't called like a regular function,
but has to take care of saving and restoring call-clobbered registers itself.

  Rainer

[Bug rtl-optimization/70222] Test miscompiled with -O1

2016-03-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222

--- Comment #6 from Jakub Jelinek  ---
Created attachment 37956
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37956&action=edit
gcc6-pr70222.patch

This untested patch works.  Though, if that is the right way to go, I'd
bootstrap/regtest it with some statistics gathering hack to see how often does
it trigger.

[Bug libfortran/69799] FAIL: gfortran.dg/coarray_allocate_3.f08 at -O1 and above

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69799

--- Comment #5 from Dominique d'Humieres  ---
Could you please test the following patch

--- ../_clean/gcc/testsuite/gfortran.dg/coarray_allocate_3.f08  2016-02-03
19:58:35.0 +0100
+++ gcc/testsuite/gfortran.dg/coarray_allocate_3.f082016-03-14
14:12:28.0 +0100
@@ -1,5 +1,6 @@
 ! { dg-do run }
 ! { dg-options "-fcoarray=single" }
+! { dg-additional-options "-latomic" { target hppa-*-* } }
 !
 ! Contributed by Ian Harvey  
 ! Extended by Andre Vehreschild  

?

[Bug middle-end/55152] MAX_EXPR(a,-a) is really ABS_EXPR(a)

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55152

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 CC||rguenth at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #5 from Richard Biener  ---
Now sth for match.pd for integers we get

  :
  _2 = -a_1(D);
  _3 = MAX_EXPR ;
  return _3;

even w/o -ffast-math.

[Bug c/59424] Optimization issue on min/max

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59424

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 Ever confirmed|0   |1

--- Comment #4 from Richard Biener  ---
Note that phiopt could still do min/max detection of a derived value, thus
for the PHI args look through unary ops it can associate a min/max with
and re-write as op (min/max (a, b)).  Not sure if that's worth it complicating
the code.

Other than that removing the

  else if (TREE_CODE (arg0) == COND_EXPR)
{

from fold_unary that does the operation sinking would "fix" this as well.

[Bug target/70220] [x86] interrupt attribute optionally needs to provide read, write and control the set of saved registers

2016-03-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70220

--- Comment #3 from H.J. Lu  ---
(In reply to Wink Saville from comment #2)
> (In reply to H.J. Lu from comment #1)
> > (In reply to Wink Saville from comment #0)
> > > I have identified one possible problem and with this scheme, what if the
> > > compiler needs to setup a stack frame by pushing rbp and then moving rsp 
> > > to
> > > rbp, how would that case be handled.
> > 
> > Why should be it a problem unless you don't want to restore RSP and RBP
> > to its original values upon returning from ISR.  Please provide an example
> > here.
> 
> Here a possible example, I added a printf and local variables to
> timer_reschedule_isr:
> 
> void timer_reschedule_isr(struct intr_frame* frame) {
>   __asm__ volatile(""::: "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp",
>  "r8",  "r9",  "r10", "r11", "r12", "r13", "r14",
> "r15");
> 

> If I now remove "rbp" from the clobber list it compiles:
>

rbp is special.  Will remove rbp from the clobber list cause any
problems here?

[Bug tree-optimization/66580] max reduction does not auto vectorize

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66580

Richard Biener  changed:

   What|Removed |Added

 Target||x64-mingw
 Status|NEW |WAITING

--- Comment #2 from Richard Biener  ---
Not sure, but it works for me with GCC 5.3.0 on x86_64-linux, also with GCC
4.9.

[Bug target/70220] [x86] interrupt attribute optionally needs to provide read, write and control the set of saved registers

2016-03-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70220

--- Comment #4 from H.J. Lu  ---
(In reply to Wink Saville from comment #0)
> I'm using the new C interrupt attribute for x86 and its working well. But
> when I expanded its use to include handling thread context switches, I found
> that its current implementation lacking.
> 
> When using an ISR for a thread context it is necessary to save and restore
> all registers but by default it saves a few as it thinks are necessary. It
> is possible to use the clobber list of inline assembly to tell the interrupt
> attribute code to save additional registers but you can't seem to mention
> the segment registers in that clobber list, thus to save these additional
> registers you must manually save them manually.
> 

Compiler doesn't use segment registers, except for TLS, which should
be used in ISR.  ISR needs to save and restore any registers, which
aren't used by compilers, if they are changed in ISR.

[Bug fortran/66643] Missing compilation error for formatted data transfer without format

2016-03-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66643

--- Comment #5 from Dominique d'Humieres  ---
> Created attachment 37610 [details]
> A preliminary patch
>
> Attached patch gives a diagnostic. Interestingly I found three test cases
> in the test suite that use the invalid construct.

Works as expected without regression.

[Bug tree-optimization/68894] Recognition min/max pattern with multiple arguments.

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68894

--- Comment #4 from Richard Biener  ---
This is a missed code hoisting opportunity again.

  _6 = a1[i_24];
  _7 = a2[i_24];
  if (_6 < _7)
goto ;
  else
goto ;

  :
  _8 = a3[i_24];
  _22 = MIN_EXPR <_6, _8>;
  goto ;

  :
  _9 = a3[i_24];
  _28 = MIN_EXPR <_7, _9>;

  :
  # d_2 = PHI <_22(6), _28(7)>

we fail to hoist/CSE _8/_9 here.  There is another PR speaking about a similar
issue of phiopt / CSE / hoisting interaction.

[Bug sanitizer/70147] [6 Regression] testcase from hana testsuite gets miscompiled with -fsanitize=undefined

2016-03-14 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org
  Known to work||5.3.0
Summary|testcase from hana  |[6 Regression] testcase
   |testsuite gets miscompiled  |from hana testsuite gets
   |with -fsanitize=undefined   |miscompiled with
   ||-fsanitize=undefined
  Known to fail||6.0

--- Comment #8 from Volker Reichelt  ---
This is a regression that was introduced between the 20160228 snapshot and the
20160306 snapshot.

[Bug fortran/70198] simple test floating point sequence gives incorrect values-- optimizer changes them

2016-03-14 Thread scott.b.dorsey at nasa dot gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70198

--- Comment #7 from scott.b.dorsey at nasa dot gov ---
Oh, that is lovely.  Many many thanks.

This code is from the "Numerical Recipes in Fortran" book and has been used
around here as a standard
test for the past 40 years without anyone noticing this.
--scott


From: dominiq at lps dot ens.fr [gcc-bugzi...@gcc.gnu.org]
Sent: Saturday, March 12, 2016 4:32 AM
To: s.b.dor...@larc.nasa.gov
Subject: [Bug fortran/70198] simple test floating point sequence gives
incorrect values-- optimizer changes them

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70198

--- Comment #6 from Dominique d'Humieres  ---
> If the code is compiled with the -fno-automatic option,
> one generates the desired result.  Note I said desired,
> not correct, because the code has a significant bug.
> When m=2 (see comment #4), the computed goto jumps to
> label 4.  The do-loop with the label 6 is executed.
> The variable 'a' is undefined.  It appears that this
> subroutine needs a SAVE statement.

Same problem with the array q. The code gives the "desired"
result with the following patch

--- pr70198.f   2016-03-11 22:10:39.0 +0100
+++ pr70198_db_1.f  2016-03-12 10:26:36.0 +0100
@@ -164,6 +164,7 @@ C
 C  This routine performs Runge-Kutta calculation by Gills Method
 C
   dimension y(10),f(10),q(10)
+  save a, q
   m=m+1
   go to (1,4,5,3,7), m
 1 do 2 i=1,n

--
You are receiving this mail because:
You reported the bug.

[Bug sanitizer/70147] [6 Regression] testcase from hana testsuite gets miscompiled with -fsanitize=undefined

2016-03-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

--- Comment #9 from Martin Liška  ---
(In reply to Volker Reichelt from comment #8)
> This is a regression that was introduced between the 20160228 snapshot and
> the 20160306 snapshot.

Yeah, it was introduced by Jakub's patch:

commit e968ff6d2edad40dcc7508d413d05b71a010e2ce
Author: jakub 
Date:   Fri Mar 4 22:10:49 2016 +

PR c++/70035
* cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
* decl.c (start_preparsed_function): Call
cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
* cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.

* g++.dg/ubsan/pr70035.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233984
138bc75d-0d04-0410-961f-82ee72b054a4

Martin

[Bug libfortran/69799] FAIL: gfortran.dg/coarray_allocate_3.f08 at -O1 and above

2016-03-14 Thread dave.anglin at bell dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69799

--- Comment #6 from dave.anglin at bell dot net ---
On 2016-03-14 9:19 AM, dominiq at lps dot ens.fr wrote:
> Could you please test the following patch
Actually, I already have but "hppa-*-*" should be 
"libatomic_available".  There are one
or two tests with this.

[Bug target/70098] PowerPC64: eigen hits ICE following invalid register assignment

2016-03-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70098

--- Comment #8 from Segher Boessenkool  ---
Author: segher
Date: Mon Mar 14 14:18:44 2016
New Revision: 234181

URL: https://gcc.gnu.org/viewcvs?rev=234181&root=gcc&view=rev
Log:
rs6000: Handle "d" output in the bd*z patterns (PR70098)

In the rs6000 port, FLOAT_REGS can contain DImode values when compiling
for 64-bit targets.  Some instructions (like "fcfid" in the testcase,
convert from integer to DP float) only work on floating point registers.
So, we do want to allow DImode in these regs.

Now, in unusual cases IRA will assign FLOAT_REGS to some allocno where
some insns cannot handle FLOAT_REGS there, so they will need a reload.
Maybe IRA can be made smarter, but it isn't doing anything wrong here,
so we should be able to handle it.

The place it goes wrong is in the output of the *ctrdi_internal[1256]
pattern: the "bdz" and "bdnz" instructions.  GCC refuses to do output
reloads on JUMP_INSNs, probably because it is hard to do, needs different
strategies than "normal" reloads do, and it cannot even be done at all
for general patterns.  So JUMP_INSNs need to be able to handle every
possible output for the register class used.

These patterns already handle writing to "c" (the base insn case), and
to "r", "m", and "c" or "l"; all those via splitters.  We just need to
handle "d" as well.  That is what this patch does.  [A predicate in one
of the splitters needs to be touched up so that the correct splitter
is used for the FLOAT_REGS case.]

But, that leaves another problem.  One of the insns that are split to
is a move from a GPR to an FPR.  That work fine on targets with direct
move (which does exactly that), i.e. power8 and up.  But older targets
need memory to do the move, and this splitter runs after reload so
it cannot allocate memory; and allocating memory beforehand for every
bdnz insn is pretty horrible as well.

This patch implements the easy part.  With it, power8 works, where it
didn't before.


PR target/70098
* config/rs6000/rs6000.md (*ctr_internal1, *ctr_internal2,
*ctr_internal5, *ctr_internal6): Also allow "d" as output.
(define_split for the GPR case): Use int_reg_operand instead of
gpc_reg_operand for the output.

gcc/testsuite/
PR target/70098
* lib/target-supports.exp (check_effective_target_powerpc64_no_dm):
New function.
* g++.dg/pr70098.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/pr70098.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.md
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-supports.exp

[Bug debug/24801] -d option changes debug information

2016-03-14 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24801

Oleg Endo  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

[Bug other/29842] [meta-bug] outstanding patches / issues from STMicroelectronics

2016-03-14 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29842
Bug 29842 depends on bug 24801, which changed state.

Bug 24801 Summary: -d option changes debug information
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24801

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

[Bug middle-end/70219] [6 Regression] ICE: in delete_move_and_clobber, at lra-constraints.c:5864 with -O2

2016-03-14 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70219

--- Comment #4 from Vladimir Makarov  ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 37953 [details]
> gcc6-pr70219.patch
> 
> Untested fix.  The code had assertion dregno > 0, but I don't see anything
> special on register 0 (%rax on x86_64), assuming Vlad meant >= 0 here (i.e.
> make sure dregno is not negative, which is not a hard register, but has
> special meaning).

Yes,  I meant >=0.   I am really sorry for such obvious mistake.  I was to
distracted to other things.

Jakub, could submit your patch.

[Bug tree-optimization/56365] [4.9/5 Regression] Missed opportunities for smin/smax standard name patterns when compiling as C++

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Mon Mar 14 14:50:40 2016
New Revision: 234183

URL: https://gcc.gnu.org/viewcvs?rev=234183&root=gcc&view=rev
Log:
2016-03-14  Richard Biener  

PR tree-optimization/56365
* tree-ssa-phiopt.c (minmax_replacement): Handle alternate
constants to compare against.

* gcc.dg/tree-ssa/phi-opt-14.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-14.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-phiopt.c

[Bug tree-optimization/56365] [4.9/5 Regression] Missed opportunities for smin/smax standard name patterns when compiling as C++

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

Richard Biener  changed:

   What|Removed |Added

  Known to work||6.0
Summary|[4.9/5/6 Regression] Missed |[4.9/5 Regression] Missed
   |opportunities for smin/smax |opportunities for smin/smax
   |standard name patterns when |standard name patterns when
   |compiling as C++|compiling as C++
  Known to fail|6.0 |

--- Comment #10 from Richard Biener  ---
Fixed on trunk sofar.  Not exactly planning to backport.

[Bug target/70117] ppc long double isinf() is wrong?

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70117

Richard Biener  changed:

   What|Removed |Added

 Target||powerpc*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-14
 Ever confirmed|0   |1

--- Comment #9 from Richard Biener  ---
So another way to "fix" this would be to stop the simplification of isinf
to isgreater(fabs(x),DBL_MAX) by providing patterns for isinf and friends
(isfinite, isnormal), see fold_builtin_interclass_mathfn.  Though neither
isfinite nor isnormal have associated optabs - breaking testcases for them
could be easily constructed.

For the long double case more optimal implementation should be possible in
the backend.  Given we can't easily expose long double implementation
details on GENERIC/GIMPLE it needs to be done there (well, in theory
we could use sth. like VIEW_CONVERT  (ldbl_1).d[0]
or so ... or REALPART (V_C_E <_Complex double> (ldbl_1)) whatever would
work better.  But then struct realformat needs to expose this fact
(real.c checks fmt->pnan < fmt->p for this!?).

Confirmed anyway.

The question remains whether the long double value from gnulib is "valid"
(it's a valid bit pattern that is _not_ inf after all).  I still somewhat
think that GCC is at fault here and not gnulib - even if it is technically
not LDBL_MAX that is wrong but the folding to isgreater(fabs(x),DBL_MAX).

[Bug tree-optimization/70225] New: ICE at tree.c:10783

2016-03-14 Thread tarasevich at cs dot uni-saarland.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70225

Bug ID: 70225
   Summary: ICE at tree.c:10783
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tarasevich at cs dot uni-saarland.de
  Target Milestone: ---

Created attachment 37957
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37957&action=edit
test case

Test case pr24257.c from torture test suite triggers ICE at tree.c:10783, when
compiled with "-Os -fcheck-data-deps". GCC 5.3.0 built from source on Ubuntu
14.04

../build/gcc_530_clean_bin/bin/gcc -Os -fcheck-data-deps -v -save-temps
/home/tarasevich/source/gcc_530/gcc/testsuite//gcc.dg//torture//pr24257.c
Using built-in specs.
COLLECT_GCC=../build/gcc_530_clean_bin/bin/gcc
COLLECT_LTO_WRAPPER=/home/tarasevich/build/gcc_530_clean_bin/libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../../source/gcc_530/configure
--prefix=/home/tarasevich/build/gcc_530_clean_bin/ --enable-languages=c
--disable-multilib --disable-bootstrap
CC=/home/tarasevich/build/llvm_371_bin/bin/clang
CXX=/home/tarasevich/build/llvm_371_bin/bin/clang++
Thread model: posix
gcc version 5.3.0 (GCC) 
COLLECT_GCC_OPTIONS='-Os' '-fcheck-data-deps' '-v' '-save-temps'
'-mtune=generic' '-march=x86-64'

/home/tarasevich/build/gcc_530_clean_bin/libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/cc1
-E -quiet -v -imultiarch x86_64-linux-gnu
/home/tarasevich/source/gcc_530/gcc/testsuite//gcc.dg//torture//pr24257.c
-mtune=generic -march=x86-64 -fcheck-data-deps -Os -fpch-preprocess -o
pr24257.i
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/home/tarasevich/build/gcc_530_clean_bin/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/home/tarasevich/build/gcc_530_clean_bin/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include
 /usr/local/include
 /home/tarasevich/build/gcc_530_clean_bin/include

/home/tarasevich/build/gcc_530_clean_bin/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-Os' '-fcheck-data-deps' '-v' '-save-temps'
'-mtune=generic' '-march=x86-64'

/home/tarasevich/build/gcc_530_clean_bin/libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/cc1
-fpreprocessed pr24257.i -quiet -dumpbase pr24257.c -mtune=generic
-march=x86-64 -auxbase pr24257 -Os -version -fcheck-data-deps -o pr24257.s
GNU C11 (GCC) version 5.3.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.2.1 Compatible Clang 3.7.1
(tags/RELEASE_371/final 263010), GMP version 5.1.3, MPFR version 3.1.2-p3, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C11 (GCC) version 5.3.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.2.1 Compatible Clang 3.7.1
(tags/RELEASE_371/final 263010), GMP version 5.1.3, MPFR version 3.1.2-p3, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c53bb545b4c066cdbf5e42f0b9d9ad8b
/home/tarasevich/source/gcc_530/gcc/testsuite//gcc.dg//torture//pr24257.c: In
function 'oof':
/home/tarasevich/source/gcc_530/gcc/testsuite//gcc.dg//torture//pr24257.c:20:6:
internal compiler error: in int_cst_value, at tree.c:10783
 void oof(A *s, int n)
  ^
0xaed214 int_cst_value(tree_node const*)
../../../source/gcc_530/gcc/tree.c:10783
0xece07d init_omega_eq_with_af(omega_pb_d*, unsigned int, unsigned int,
tree_node*, data_dependence_relation*)
../../../source/gcc_530/gcc/tree-data-ref.c:3772
0xecd417 omega_setup_subscript(tree_node*, tree_node*,
data_dependence_relation*, omega_pb_d*, bool*)
../../../source/gcc_530/gcc/tree-data-ref.c:3922
0xecd417 init_omega_for_ddr_1(data_reference*, data_reference*,
data_dependence_relation*, omega_pb_d*, bool*)
../../../source/gcc_530/gcc/tree-data-ref.c:3959
0xec7b63 init_omega_for_ddr(data_dependence_relation*, bool*)
../../../source/gcc_530/gcc/tree-data-ref.c:4142
0xec7b63 compute_affine_dependence(data_dependence_relation*, loop*)
../../../source/gcc_530/gcc/tree-data-ref.c:4301
0xec83ba compute_all_dependences(vec,
vec*, vec,
bool)
../../../source/gcc_530/gcc/tree-data-ref.c:4384
0xec8de8 compute_data_dependences_for_loop(loop*, bool, vec*, vec*,
vec*)
../../../source/gcc_530/gcc/tree-data-ref.c:4712
0xec9148 analyze_all_data_dependences(loop*)
../../../source/gcc_530/gcc/tree-data-ref.c:4820
0xec9148 tree_check_data_deps()
../../../source/gcc_530/gcc/tree-data-ref.c:4868
0xa1b99d (anonymous namespace)::pass_check_data_deps::execute(function*)
../../../source/gcc_530/gcc/tree-ssa-loop.c:342
Please submit a ful

[Bug target/70117] ppc long double isinf() is wrong?

2016-03-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70117

--- Comment #10 from Richard Biener  ---
So, "simplest" patch:

Index: gcc/builtins.c
===
--- gcc/builtins.c  (revision 234180)
+++ gcc/builtins.c  (working copy)
@@ -7529,6 +7529,13 @@ fold_builtin_interclass_mathfn (location

   mode = TYPE_MODE (TREE_TYPE (arg));

+  /* Do not perform this simplification for IBM extended double
+ which is made up of two IEEE doubles where only the first
+ one is relevant to the result of isinf, isfinite and isnormal.  */
+  const struct real_format *fmt = FLOAT_MODE_FORMAT (mode);
+  if (fmt->pnan < fmt->p)
+return NULL_TREE;
+
   /* If there is no optab, try generic code.  */
   switch (DECL_FUNCTION_CODE (fndecl))
 {

but it will end up with libcalls for isinf, isfinite and isnormal for
IBM extended double.  I'm told glibc does the right thing for the gnulib
DBL_MAX.

PPC people should evaluate if that's eventually even more efficient than
the inlining with the comparison against the large constant immediate.

[Bug target/70083] [6 Regression] ICE: in assign_stack_local_1, at function.c:409 with -fschedule-insns -mavx512* @ i686

2016-03-14 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70083

--- Comment #5 from Bernd Schmidt  ---
Author: bernds
Date: Mon Mar 14 15:08:54 2016
New Revision: 234184

URL: https://gcc.gnu.org/viewcvs?rev=234184&root=gcc&view=rev
Log:
LRA: identify biggest access mode for hard_regs and use it in split_reg

PR target/70083
* lra-lives.c (process_bb_lives): Also update biggest mode for hard
regs.
(lra_create_live_ranges_1): initialize hard register biggest_mode to
VOIDmode.
* lra-constraints.c (split_reg): For hard regs, try to find the
biggest single-register mode used in the function.

testsuite/
PR target/70083
* gcc.dg/torture/pr70083.c: New test.
* gcc.target/i386/pr70083.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr70083.c
trunk/gcc/testsuite/gcc.target/i386/pr70083.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lra-constraints.c
trunk/gcc/lra-lives.c
trunk/gcc/testsuite/ChangeLog

  1   2   >