[Bug middle-end/80995] Unparallelized Fortran OpenACC kernels after Fortran loop optimizations

2017-06-07 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80995

Thomas Schwinge  changed:

   What|Removed |Added

Summary|Fortran OpenACC kernels |Unparallelized Fortran
   |"Unhandled stmt in  |OpenACC kernels after
   |entry/exit: _14 =   |Fortran loop optimizations
   |BUILTIN_EXPECT ([...])" |
   |after "Introduce fortran|
   |loop preheader" |

--- Comment #2 from Thomas Schwinge  ---
With trunk r238114 "Optimize fortran loops with +-1 step" merged in, the two
regressions mentioned before are gone again, but instead, the following fail to
parallelize with "-Os" (only):

  * libgomp.oacc-fortran/asyncwait-1.f90
  * libgomp.oacc-fortran/deviceptr-1.f90
  * libgomp.oacc-fortran/kernels-loop-2.f95
  * libgomp.oacc-fortran/kernels-loop-data-2.f95
  * libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
  * libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
  * libgomp.oacc-fortran/kernels-loop-data-update.f95
  * libgomp.oacc-fortran/kernels-loop-data.f95
  * libgomp.oacc-fortran/kernels-loop.f95
  * libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95
  * libgomp.oacc-fortran/non-scalar-data.f90

With nvptx offloading, this is observed as: "warning: OpenACC kernels construct
will be executed sequentially; will by default avoid offloading to prevent data
copy penalty".

I did not try to understand what it is that parloops doesn't like.

[Bug target/81015] New: Bad codegen for __builtin_clz(unsigned short)

2017-06-07 Thread m101010a at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81015

Bug ID: 81015
   Summary: Bad codegen for __builtin_clz(unsigned short)
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: m101010a at gmail dot com
  Target Milestone: ---

When compiling with "-O1 -mlzcnt", __builtin_clz applied to an unsigned short
generates the lzcntw instruction instead of lzcntl.  Given the following source
code:

int main()
{
// volatile ensures the clz happens at runtime
volatile unsigned short bits_ = 1;
return __builtin_clz(bits_);
}

Compiling with no optimization produces a binary that correctly returns 31, as
does compiling it with gcc 6.3, but with gcc 7.1 and optimization the binary
returns 15 instead.  This happens for both 64-bit and 32-bit code, for both C
and C++, and for -O1, -O2, and -O3.

[Bug c++/81014] New: internal compiler error: in make_decl_rtl, at varasm.c:1311

2017-06-07 Thread rain.backnet at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81014

Bug ID: 81014
   Summary: internal compiler error: in make_decl_rtl, at
varasm.c:1311
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rain.backnet at gmail dot com
  Target Milestone: ---

Unfortunately source and preprocessed files are not available in this instance,
but hopefully this is still of some use.



In file included from
/home/slowriot/code/sphereface/vectorstorm/vectorstorm.h:109:0,
 from
/home/slowriot/code/sphereface/vectorstorm/vectorstorm.cpp:1:
/home/slowriot/code/sphereface/vectorstorm/quat/quat.h: In constructor
‘constexpr quaternion::quaternion(const matrix3&) [with T = long
double]’:
/home/slowriot/code/sphereface/vectorstorm/quat/quat.h:119:34: internal
compiler error: in make_decl_rtl, at varasm.c:1311
   root = static_cast(0.5) / root;  
 // 1/(4w)
  ^~
0xd2801d make_decl_rtl(tree_node*)
../../src/gcc/varasm.c:1307
0x863f27 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../src/gcc/expr.c:9804
0x86c505 expand_expr
../../src/gcc/expr.h:276
0x86c505 expand_expr_addr_expr_1
../../src/gcc/expr.c:7782
0x862dde expand_expr_addr_expr
../../src/gcc/expr.c:7903
0x862dde expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../src/gcc/expr.c:11046
0x863bf2 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../src/gcc/expr.c:9773
0x873847 expand_expr
../../src/gcc/expr.h:276
0x873847 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../src/gcc/expr.c:8301
0x77fc6d expand_gimple_stmt_1
../../src/gcc/cfgexpand.c:3676
0x77fc6d expand_gimple_stmt
../../src/gcc/cfgexpand.c:3737
0x780b9f expand_gimple_basic_block
../../src/gcc/cfgexpand.c:5744
0x785ce6 execute
../../src/gcc/cfgexpand.c:6357
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/80593] [7 Regression] GCC 7, aligned_storage and “dereferencing type-punned pointer will break strict-aliasing rules”

2017-06-07 Thread daniel.black at au dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80593

--- Comment #13 from Daniel Black  ---
Thanks Richard.

[Bug testsuite/80976] FAIL: c-c++-common/Wfloat-conversion.c -std=gnu++98 (test for warnings, line 42)

2017-06-07 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80976

John David Anglin  changed:

   What|Removed |Added

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

--- Comment #2 from John David Anglin  ---
Fixed.

[Bug target/80982] gcc.target/powerpc/builtins-3-runnable.c fails starting with its introduction in r248846

2017-06-07 Thread carll at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80982

--- Comment #2 from Carl Love  ---
Author: carll
Date: Wed Jun  7 22:03:48 2017
New Revision: 248997

URL: https://gcc.gnu.org/viewcvs?rev=248997&root=gcc&view=rev
Log:
gcc/ChangeLog:

2017-06-07  Carl Love  

PR target/80982
* config/rs6000/altivec.md (double2): Fix the implementation of
for BE.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/altivec.md

[Bug c++/81013] New: [7/8 Regression] ICE with invalid union in class hierarchy

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81013

Bug ID: 81013
   Summary: [7/8 Regression] ICE with invalid union in class
hierarchy
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 7.1.0:

=
struct A
{
  virtual void foo() const;
};

union B : A
{
  void foo() const;
};

void bar(const B& b)
{
  b.foo();
}
=

bug.cc:6:11: error: derived union 'B' invalid
 union B : A
   ^
during GIMPLE pass: *build_cgraph_edges
bug.cc: In function 'void bar(const B&)':
bug.cc:11:6: internal compiler error: in create_indirect_edge, at cgraph.c:962
 void bar(const B& b)
  ^~~
0x96667b cgraph_node::create_indirect_edge(gcall*, int, profile_count, int,
bool)
../../gcc/gcc/cgraph.c:962
0x96bd2c execute
../../gcc/gcc/cgraphbuild.c:341
Please submit a full bug report, [etc.]

[Bug tree-optimization/81008] missing optimization for restricted pointers passed to functions

2017-06-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81008

Martin Sebor  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=81009

--- Comment #3 from Martin Sebor  ---
See also bug 81009 for another optimization opportunity offered by restrict.

[Bug tree-optimization/81008] missing optimization for restricted pointers passed to functions

2017-06-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81008

--- Comment #2 from Martin Sebor  ---
Restrict imposes additional constraints even on accesses to objects via
non-restricted pointers.  The one relevant to this report is in 6.7.3.1, p4:

  -4-  During each execution of B, let L be any lvalue that has &L based on P. 
If L is used to access the value of the object X that it designates, and X is
also modified (by any means), then the following requirements apply: [...]
Every other lvalue used to access the value of X shall also have its address
based on P. ...

The example in C11 6.7.3.1 illustrates them:

  -7-  EXAMPLE 1   The file scope declarations

int * restrict a;
int * restrict b;
extern int c[];

   assert that if an object is accessed using one of a, b, or c, and that
object is modified anywhere in the program, then it is never accessed using
either of the other two.

Applying this to the program in comment #1 means that since *p is used to
access object X (i.e., p = &X), if X were to be modified by the call to f() it
would have to be through a pointer based on p, not by some other pointer
obtained from &X prior to the execution of g().  That such a pointer would not
be based on p is explained in paragraphs 1 through 3 of the same section.

[Bug target/81012] New: ARM: Spill instead of register copy / dead store on int-to-double conversion

2017-06-07 Thread gergo.barany at inria dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81012

Bug ID: 81012
   Summary: ARM: Spill instead of register copy / dead store on
int-to-double conversion
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gergo.barany at inria dot fr
  Target Milestone: ---

Created attachment 41496
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41496&action=edit
Input C file for triggering the issue

Input file (also in attachment):

double fn2(int p1, int p2) {
  double a = p1;
  if (744073425321881 * p2 + 5)
a = 2;
  return a;
}

Generated code on ARMv7 for VFPv3:

$ gcc tst.c -Wall -Wextra -O3 -fomit-frame-pointer -S -o -
[...]
fn2:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
movwr3, #42171
movtr3, 2
push{r4, r5}
movwr2, #65433
sub sp, sp, #8
asr r5, r1, #31
movtr2, 6195
mvn r4, #4
mul r3, r3, r1
str r0, [sp, #4]   // SPILL
mla r0, r2, r5, r3
mvn r5, #0
umull   r2, r3, r1, r2
add r3, r0, r3
cmp r3, r5
cmpeq   r2, r4
vldreq.32   s15, [sp, #4]   @ int
vmovne.f64  d0, #2.0e+0
vcvteq.f64.s32  d0, s15
add sp, sp, #8
@ sp needed
pop {r4, r5}
bx  lr
.size   fn2, .-fn2
.ident  "GCC: (GNU) 8.0.0 20170606 (experimental)"

Note the store I marked "SPILL". It is a store of the integer register r0 which
is reloaded on the line marked "@ int" into a floating-point register for
subsequent int-to-double conversion. The spill frees r0 for other use, but it
would be better to just replace the spill/reload sequence with

vmov s15, r0

since the register is available.

Also, if the large constant 744073425321881 in the if condition is changed to
something smaller like 1881 (that fits into a mov's immediate field), GCC
generates this code:

fn2:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
movwr3, #1881
sub sp, sp, #8
mul r1, r3, r1
str r0, [sp, #4]// DEAD STORE
cmn r1, #5
vmovne.f64  d0, #2.0e+0
vmoveq  s15, r0 @ int
vcvteq.f64.s32  d0, s15
add sp, sp, #8
@ sp needed
bx  lr

This does perform a conditional move from r0 to s15, but it also generates a
dead store to the stack.

Clang and CompCert both just do a copy and don't touch the stack for this
value.

$ gcc -v
[...]
Target: armv7a-eabihf
Configured with: --target=armv7a-eabihf --with-arch=armv7-a
--with-fpu=vfpv3-d16 --with-float-abi=hard --with-float=hard
Thread model: single
gcc version 8.0.0 20170510 (experimental) (GCC)

Not sure if this is related to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80861 which also the stack for a
float-to-char conversion. But that's the other direction, and if I understand
correctly, there the problem is related to the final sign extension.

[Bug c++/81011] New: [6/7/8 Regression] ICE with #pragma omp task and inaccessible copy-constructor

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81011

Bug ID: 81011
   Summary: [6/7/8 Regression] ICE with #pragma omp task and
inaccessible copy-constructor
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code, openmp
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 6.1.0
(when compiled with -fopenmp):

==
class A
{
  A(const A&);
};

void foo(const A&);

void bar(const A& a)
{
#pragma omp task
  foo(a);
}
==

bug.cc: In function 'void bar(const A&)':
bug.cc:10:9: error: 'A::A(const A&)' is private within this context
 #pragma omp task
 ^~~
bug.cc:3:3: note: declared private here
   A(const A&);
   ^
during GIMPLE pass: omplower
bug.cc:10:9: internal compiler error: Segmentation fault
 #pragma omp task
 ^~~
0xd7564f crash_signal
../../gcc/gcc/toplev.c:338
0xc624f1 scan_sharing_clauses
../../gcc/gcc/omp-low.c:1405
0xc65f58 scan_omp_task
../../gcc/gcc/omp-low.c:1881
0xc65f58 scan_omp_1_stmt
../../gcc/gcc/omp-low.c:3170
0xae9376 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:568
0xae9570 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0xae9441 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:595
0xae9570 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0xc59b3d scan_omp
../../gcc/gcc/omp-low.c:3246
0xc6f35a execute_lower_omp
../../gcc/gcc/omp-low.c:8981
0xc6f35a execute
../../gcc/gcc/omp-low.c:9028
Please submit a full bug report, [etc.]

[Bug tree-optimization/81010] [8 regression] test case gcc.target/powerpc/pr56605.c fails starting with r248958

2017-06-07 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81010

seurer at gcc dot gnu.org changed:

   What|Removed |Added

 Target||powerpc64-unknown-linux-gnu
 CC||amker at gcc dot gnu.org,
   ||wschmidt at gcc dot gnu.org
   Host||powerpc64-unknown-linux-gnu
  Build||powerpc64-unknown-linux-gnu

--- Comment #1 from seurer at gcc dot gnu.org ---
Seen on power 6, 7, and 8.

[Bug tree-optimization/81010] New: [8 regression] test case gcc.target/powerpc/pr56605.c fails starting with r248958

2017-06-07 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81010

Bug ID: 81010
   Summary: [8 regression] test case gcc.target/powerpc/pr56605.c
fails starting with r248958
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

This only occurs on BE.

spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.target/powerpc/pr56605.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O3 -mvsx -mcpu=power7
-fno-unroll-loops -fdump-rtl-loop2_doloop -ffat-lto-objects -S -o pr56605.s
PASS: gcc.target/powerpc/pr56605.c (test for excess errors)
FAIL: gcc.target/powerpc/pr56605.c scan-rtl-dump-times loop2_doloop
"\\(compare:CC \\(subreg:SI \\(reg:DI" 1

[Bug tree-optimization/81009] New: missing aliasing optimization for const restrict pointers

2017-06-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81009

Bug ID: 81009
   Summary: missing aliasing optimization for const restrict
pointers
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

One of the constraints on the use of restrict-qualified pointers is that the
const qualifier effectively imposes a binding requirement on such a pointer
preventing it from being used to modify the object (this is specified in
6.7.3.1, p4: "If L is used to access the value of the object X that it
designates, and X is also modified (by any means), then the following
requirements apply: T shall not be const-qualified.")

This constraint doesn't exist for ordinary (not restrict-qualified) const
pointers where the constness can be cast away and the result used to modify the
pointed-to object (provided the object itself isn't const).

GCC could take advantage of this constraint on programs by assuming that the
call to f() in g() below doesn't modify *p, thus eliminating the subsequent
test for x != *p.

$ cat t.c && gcc -O3 -S -Wall -Wrestrict -fdump-tree-optimized=/dev/stdout t.c

void f (const int*);

static void g (const int* restrict p)
{
  int x = *p;
  f (p); // f() cannot modify *p here
  if (x != *p)   // cannot be true
__builtin_abort ();
}

void h (void)
{
  int i = 0;
  g (&i);
}

;; Function h (h, funcdef_no=1, decl_uid=1799, cgraph_uid=1, symbol_order=1)

h ()
{
  int i;
  int _4;

   [100.00%]:
  i = 0;
  f (&i);
  _4 = MEM[(const int *)&i];
  if (_4 != 0)
goto ; [0.04%]
  else
goto ; [99.96%]

   [0.04%]:
  __builtin_abort ();

   [99.96%]:
  i ={v} {CLOBBER};
  return;

}

[Bug ipa/81000] std::any improvement

2017-06-07 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81000

Marc Glisse  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-07
 CC||marxin at gcc dot gnu.org
  Component|c++ |ipa
 Ever confirmed|0   |1

--- Comment #2 from Marc Glisse  ---
This is almost a duplicate of similar PRs about std::function, etc. We discover
that _S_manage is the function that is called only in FRE3, much too late to
inline it. IIRC, LLVM alternates between inlining and other optimizations,
which helps a lot on this kind of code. Sprinkling
__attribute__((always_inline)) is not sufficient, we need to inline one
function before FRE or similar can propagate which function is called next and
needs inlining before FRE etc.

(Of course, a different implementation of std::any might be easier to optimize)

[Bug libfortran/80850] Sourced allocate() fails to allocate a pointer

2017-06-07 Thread liakhdi at ornl dot gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80850

--- Comment #10 from DIL  ---
Sorry, just wanted to clarify few things. I am still struggling with this issue
I reported. However I am not sure if you could every reproduce it (it seemed
like you observed a different issue)? Namely, if by running the binary built
from here
"https://gitlab.com/DmitryLyakh/GFC.git";
you could see that the allocate() statement in gfc_base.F90:343 fails to
allocate a dissociated pointer (dissociated in the previous line)? For
convenience I removed few unneeded things from the code, so the code now
directly proceeds to the problematic path and explicitly (manually) crashes
(via divide by zero) to reveal the callstack when allocate() fails. I
reproduced the problem on multiple Linux machines with GNU 5.3.0, 5.4.0, and
6.3.1. The problems shows up non-deterministically, so the binary needs to be
executed 5-10 times. If I build the binary with -O3, the problem shows up much
less often. Also, another big complication is that I could never reproduce the
failing behavior inside gdb (it always works fine in gdb). Additionally, as I
mentioned before, the binary seems to be VALGRIND clean. I am running out of
ideas how to figure out what is going on wrong in that allocate() statement. We
tried to look in the GFORTRAN source "gcc-5.4.0/gcc/fortran/trans-stmt.c:6132",
but it seems like allocate() is actually parsed to something and not called as
a runtime function, so there is no way for us to understand why allocate() sees
an explicitly dissociated pointer as already allocated (and why this is
happening only occasionally and not every time). Any ideas from you guys would
be appreciated. Thanks!
Dmitry

[Bug c++/70621] [6/7/8 Regression] ICE on invalid code at -O1 and above on x86_64-linux-gnu in record_reference, at cgraphbuild.c:64

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70621

Volker Reichelt  changed:

   What|Removed |Added

   Last reconfirmed|2016-04-11 00:00:00 |2017-06-07
 CC||reichelt at gcc dot gnu.org

--- Comment #10 from Volker Reichelt  ---
Here's an even simpler example that ICEs since GCC 4.9.0:

=
float foo();

struct A
{
  static float x;
};

double A::x = foo();

void bar()
{
  A::x = 0;
}
=

bug.cc:8:11: error: conflicting declaration 'double A::x'
 double A::x = foo();
   ^
bug.cc:5:16: note: previous declaration as 'float A::x'
   static float x;
^
bug.cc:8:11: error: declaration of 'float A::x' outside of class is not
definition [-fpermissive]
 double A::x = foo();
   ^
cc1plus: internal compiler error: in record_reference, at cgraphbuild.c:64
0x96b754 record_reference
../../gcc/gcc/cgraphbuild.c:64
0x1048663 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:11838
0x1048ef2 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:12155
0x96c952 record_references_in_initializer(tree_node*, bool)
../../gcc/gcc/cgraphbuild.c:401
0x1088e07 varpool_node::analyze()
../../gcc/gcc/varpool.c:532
0x972916 analyze_functions
../../gcc/gcc/cgraphunit.c:1180
0x973cc2 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2611
Please submit a full bug report, [etc.]

[Bug tree-optimization/81008] missing optimization for restricted pointers passed to functions

2017-06-07 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81008

--- Comment #1 from Andrew Pinski  ---
Are you 100% sure this is safe.  IIRC there are specific rules about restrict
and it only takes about other pointers to restrict types.

[Bug tree-optimization/81008] New: missing optimization for restricted pointers passed to functions

2017-06-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81008

Bug ID: 81008
   Summary: missing optimization for restricted pointers passed to
functions
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

While exploring ways to annotate C++ classes or member functions to indicate
that accessing an object of the class does not change a different object of
that class I noticed that GCC doesn't take full advantage of the basic
guarantee on restrict-qualified pointers: that if one is used to access an
object, the same object may only be modified through an [lvalue] based on the
same pointer.

In the example below, the call to foo() is guaranteed not to modify the object
at *p because p is a restricted pointer and there is no other pointer based on
p can exist.

Clang emits optimal code for the test case (i.e., just a jump to foo()).

$ cat t.c && gcc -O3 -S -Wall -Wrestrict -fdump-tree-optimized=/dev/stdout t.c

void f (void);

void g (int* restrict p)
{
  int x = *p;
  f ();
  if (x != *p)
__builtin_abort ();
}

;; Function g (g, funcdef_no=0, decl_uid=1795, cgraph_uid=0, symbol_order=0)

g (int * restrict p)
{
  int x;
  int _1;

   [100.00%]:
  x_4 = *p_3(D);
  f ();
  _1 = *p_3(D);
  if (_1 != x_4)
goto ; [0.04%]
  else
goto ; [99.96%]

   [0.04%]:
  __builtin_abort ();

   [99.96%]:
  return;

}


In the above, the only way f() could modify *p is like so:

  int *q;
  void f (void) { *q = 0; }

and

  void h (void)
  {
int d = 0;
q = &d;
g (&d);
  }

but such a modification is undefined thanks to the access to d in f() through a
restricted pointer.

[Bug c++/81007] New: [7/8 Regression] ICE with virtual function in broken class

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81007

Bug ID: 81007
   Summary: [7/8 Regression] ICE with virtual function in broken
class
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid testcase triggers an ICE since GCC 7.1.0
(when compiled with -O2):

===
struct A
{
  A p;
  virtual void foo();
};

struct B : A {};

void bar(B& b)
{
  b.foo();
}
===

bug.cc:3:5: error: field 'p' has incomplete type 'A'
   A p;
 ^
bug.cc:1:8: note: definition of 'struct A' is not complete until the closing
brace
 struct A
^
bug.cc: In function 'void bar(B&)':
bug.cc:11:8: internal compiler error: Segmentation fault
   b.foo();
   ~^~
0xd7564f crash_signal
../../gcc/gcc/toplev.c:338
0xb878af contains_struct_check(tree_node const*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3452
0xb878af wi::extended_tree<128>::extended_tree(tree_node const*)
../../gcc/gcc/tree.h:5307
0xb878af generic_wide_int >::generic_wide_int(tree_node const* const&)
../../gcc/gcc/wide-int.h:745
0xb878af wi::to_offset(tree_node const*)
../../gcc/gcc/tree.h:5290
0xb878af int_bit_position(tree_node const*)
../../gcc/gcc/tree.h:5453
0xb878af ipa_polymorphic_call_context::restrict_to_inner_class(tree_node*,
bool, bool)
../../gcc/gcc/ipa-polymorphic-call.c:273
0xb886d2 contains_type_p
../../gcc/gcc/ipa-polymorphic-call.c:478
0xb86f89 ipa_polymorphic_call_context::speculation_consistent_p(tree_node*,
long, bool, tree_node*) const
../../gcc/gcc/ipa-polymorphic-call.c:1824
0xb88be5 ipa_polymorphic_call_context::combine_speculation_with(tree_node*,
long, bool, tree_node*)
../../gcc/gcc/ipa-polymorphic-call.c:1857
0xb8acc2 ipa_polymorphic_call_context::ipa_polymorphic_call_context(tree_node*,
tree_node*, gimple*, tree_node**)
../../gcc/gcc/ipa-polymorphic-call.c:909
0xae23ba possible_polymorphic_call_targets(tree_node*, gimple*, bool*, void**)
../../gcc/gcc/ipa-utils.h:126
0xadea93 gimple_fold_call
../../gcc/gcc/gimple-fold.c:3705
0xadf622 fold_stmt_1
../../gcc/gcc/gimple-fold.c:4456
0xb0fd43 gimplify_call_expr
../../gcc/gcc/gimplify.c:3364
0xb05515 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11269
0xb08938 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xb0545a gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6265
0xb0545a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11673
0xb08938 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
Please submit a full bug report, [etc.]

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||hubicka at ucw dot cz

--- Comment #7 from Markus Trippelsdorf  ---
The reduced testcase only fails on trunk.

_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev/46 (__comp_dtor )
@0x7f6d89685cf0 
  Type: function definition analyzed alias  
  Visibility: externally_visible prevailing_def 
  Address is taken. 
  References: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev/45
(alias) 
  Referring:
_Z17get_single_stringIcENSt7__cxx1112basic_stringIT_St11char_traitsIS2_ESaIS2_EEESt1AIS6_E.isra.0/60
(addr)   
  Read from file: /tmp/ccub8nvo.o   
  Availability: available   
  First run: 0  
  Function flags:   
  Called by:
  Calls:
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev/45 (__base_dtor )
@0x7f6d89685b80 
  Type: function definition analyzed
  Visibility: prevailing_def_ironly 
  Address is taken. 
  References:   
  Referring: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev/46
(alias) 
  Read from file: /tmp/ccub8nvo.o   
  Availability: available   
  First run: 0  
  Function flags: nonfreeing_fn 
  Called by:
  Calls:

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

Markus Trippelsdorf  changed:

   What|Removed |Added

  Attachment #41494|0   |1
is obsolete||

--- Comment #6 from Markus Trippelsdorf  ---
Created attachment 41495
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41495&action=edit
crappy auto reduced testcase

[Bug c/81006] New: ICE with zero-size array and #pragma omp task depend

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81006

Bug ID: 81006
   Summary: ICE with zero-size array and #pragma omp task depend
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, openmp
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following (valid?) testcase triggers an ICE since GCC 4.9.0
(when compiled with -fopenmp):

===
int a[] = {};

void foo()
{
  #pragma omp task depend(out: a[:])
{}
}
===

bug.c: In function 'foo':
bug.c:5:11: internal compiler error: in size_binop_loc, at fold-const.c:1770
   #pragma omp task depend(out: a[:])
   ^~~
0x885b57 size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../gcc/gcc/fold-const.c:1769
0x6237da handle_omp_array_sections_1
../../gcc/gcc/c/c-typeck.c:12365
0x62431d handle_omp_array_sections
../../gcc/gcc/c/c-typeck.c:12508
0x6287a8 c_finish_omp_clauses(tree_node*, c_omp_region_type)
../../gcc/gcc/c/c-typeck.c:13334
0x63684e c_parser_omp_task
../../gcc/gcc/c/c-parser.c:15713
0x63684e c_parser_omp_construct
../../gcc/gcc/c/c-parser.c:17405
0x63789e c_parser_pragma
../../gcc/gcc/c/c-parser.c:10393
0x655f5d c_parser_compound_statement_nostart
../../gcc/gcc/c/c-parser.c:4892
0x65653e c_parser_compound_statement
../../gcc/gcc/c/c-parser.c:4757
0x6527e7 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:2125
0x65a223 c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1468
0x65ac89 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1349
0x65ac89 c_parse_file()
../../gcc/gcc/c/c-parser.c:18131
0x6b8566 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

[Bug sanitizer/80953] Support libsanitizer on Solaris

2017-06-07 Thread m.ostapenko at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80953

Maxim Ostapenko  changed:

   What|Removed |Added

 CC||m.ostapenko at samsung dot com

--- Comment #6 from Maxim Ostapenko  ---
(In reply to Rainer Orth from comment #5)
> Created attachment 41484 [details]
> Merge libsanitizer from compiler-rt r304722
> 
> I've now completed a merge of llvm r304722 into gcc trunk libsanitizer. 
> Most of
> it was straightforward, but a couple of issues may save others work:
> 
> * Two bugs in sanitizer_common/sanitizer_symbolizer_libbacktrace.cc have
> already
>   been reported upstream: https://reviews.llvm.org/D33933
> 
> * In libubsan, __ubsan_handle_type_mismatch has been renamed to
>   __ubsan_handle_type_mismatch_v1, and likewise for
> __ubsan_handle_type_mismatch_abort__ubsan_handle_type_mismatch_v1_abort
> 
>   The sanitizer.def and ubsan.c changes reflect this.  Worse, however, 
>   the former uptr Alignment member of ubsan/ubsan_handlers.h was changed to
>   unsigned char LogAlignment.  This needs a corresponding gcc change to pass
>   log2(align) instead of just align.
> 
> * Many (all) */float-cast-overflow-*.c tests FAILed initially because of a
>   message change:
> 
>   runtime error: value -133 is outside the range of representable values of
> type 'signed char'
> 
>   lost the leading "value"
> 
> With these gcc side changes, testresults on x86_64-pc-linux-gnu are identical
> to those with current gcc trunk, with the exception of
> 
> +FAIL: c-c++-common/asan/pr63888.c   -O2  execution test
> +FAIL: c-c++-common/asan/pr63888.c   -O2 -flto  execution test
> +FAIL: c-c++-common/asan/pr63888.c   -O2 -flto -flto-partition=none 
> execution t
> est
> +FAIL: c-c++-common/asan/pr63888.c   -O3 -g  execution test
> +FAIL: c-c++-common/asan/pr63888.c   -Os  execution test
> 
> I get here
> 
> =
> ==4734==ERROR: AddressSanitizer: odr-violation (0x004009e0):
>   [1] size=12 'CSWTCH.1'
> /vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:
> 8:3
>   [2] size=12 'CSWTCH.3'
> /vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:
> 21:3
> These globals were registered at these points:
>   [1]:
> #0 0x7f2c9c48fb88 in __asan_register_globals
> /vol/gcc/src/hg/trunk/solaris-asan/libsanitizer/asan/asan_globals.cc:356
> #1 0x40097c in __libc_csu_init
> (/var/scratch/gcc/gcc-8.0.0-20170531/4.10.10-gcc-gas-gld-asan/gcc/testsuite/
> gcc17/pr63888.exe+0x40097c)
> 
>   [2]:
> #0 0x7f2c9c48fb88 in __asan_register_globals
> /vol/gcc/src/hg/trunk/solaris-asan/libsanitizer/asan/asan_globals.cc:356
> #1 0x40097c in __libc_csu_init
> (/var/scratch/gcc/gcc-8.0.0-20170531/4.10.10-gcc-gas-gld-asan/gcc/testsuite/
> gcc17/pr63888.exe+0x40097c)
> 
> ==4734==HINT: if you don't care about these errors you may set
> ASAN_OPTIONS=detect_odr_violation=0
> SUMMARY: AddressSanitizer: odr-violation: global 'CSWTCH.1' at
> /vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:
> 8:3
> ==4734==ABORTING
> 
> Someone who knows that code way better needs to look into this.
> 
>   Rainer

For ODR violation bug we have a local patch in libsanitizer. Could you check
whether you applied all local patches listed in libsanitizer/LOCAL_PATCHES
file?

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

--- Comment #5 from Markus Trippelsdorf  ---
Created attachment 41494
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41494&action=edit
crappy auto reduced testcase

Here's the reduced testcase anyway:

 % g++ -O2 -c value_semantic.ii
 % g++ -w -Wl,--no-demangle lines.ii options.ii -O2 -std=c++1z -flto
value_semantic.o 2>&1 | grep
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
value_semantic.o:value_semantic.ii:function _GLOBAL__sub_I__ZNSt7__cxx111aE:
error: undefined reference to
'_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev'
(ld: the symbol should have been defined by a plugin)

(without -flto )
 % g++ -w -Wl,--no-demangle lines.ii options.ii -O2 -std=c++1z value_semantic.o
2>&1 | grep _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev   
 %

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

--- Comment #4 from Markus Trippelsdorf  ---
Created attachment 41493
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41493&action=edit
unreduced testcase

Here is the unreduced testcase:

 g++ -w -flto -Wl,--no-demangle l.ii o.ii -O1 -std=c++1z
./libboost_program_options.a

The issue only happens -with -std=c++1z, c++14 works fine (but not with 
the preprocessed files).

Automatic reduction unfortunately just turns up garbage.

[Bug tree-optimization/81003] [8 Regression] ICE: tree check: expected ssa_name, have integer_cst in optimize_range_tests_to_bit_test, at tree-ssa-reassoc.c:2782

2017-06-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81003

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
I'll have a look.

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.5
  Known to fail||5.4.0, 6.3.0, 7.1.0

--- Comment #6 from Jonathan Wakely  ---
Fixed for 5.5, 6.4, 7.2

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Wed Jun  7 17:00:56 2017
New Revision: 248993

URL: https://gcc.gnu.org/viewcvs?rev=248993&root=gcc&view=rev
Log:
PR libstdc++/81002 fix std::basic_regex range constructor

PR libstdc++/81002
* include/bits/regex_compiler.h (__compile_nfa): Add template argument
list to specify traits type.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.

Added:
   
branches/gcc-5-branch/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/bits/regex_compiler.h

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Wed Jun  7 16:51:00 2017
New Revision: 248992

URL: https://gcc.gnu.org/viewcvs?rev=248992&root=gcc&view=rev
Log:
PR libstdc++/81002 fix std::basic_regex range constructor

PR libstdc++/81002
* include/bits/regex_compiler.h (__compile_nfa): Add template argument
list to specify traits type.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.

Added:
   
branches/gcc-6-branch/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/bits/regex_compiler.h

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

--- Comment #3 from Jonathan Wakely  ---
Author: redi
Date: Wed Jun  7 16:50:36 2017
New Revision: 248991

URL: https://gcc.gnu.org/viewcvs?rev=248991&root=gcc&view=rev
Log:
PR libstdc++/81002 fix std::basic_regex range constructor

PR libstdc++/81002
* include/bits/regex_compiler.h (__compile_nfa): Add template argument
list to specify traits type.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/regex_compiler.h

[Bug lto/81004] [7/8 Regression] linking failed with -flto and static libboost_program_options

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

Markus Trippelsdorf  changed:

   What|Removed |Added

   Keywords||lto
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-07
 CC||trippels at gcc dot gnu.org
Summary|linking failed with -flto   |[7/8 Regression] linking
   ||failed with -flto and
   ||static
   ||libboost_program_options
 Ever confirmed|0   |1

--- Comment #3 from Markus Trippelsdorf  ---
Confirmed. I'm currently trying to reduce the issue:

 % g++ -w -Wl,--no-demangle -flto lines.ii options.ii -O1 -std=c++1z -o options
/usr/lib/libboost_program_options.a

/usr/lib/libboost_program_options.a(value_semantic.o):value_semantic.cpp:function
_GLOBAL__sub_I__ZNK5boost15program_options29value_semantic_codecvt_helperIcE5parseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EEb:
error: undefined reference to
'_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
the symbol should have been defined by a plugin 
collect2: error: ld returned 1 exit status

[Bug fortran/80988] [8 Regression] 171_swim fails

2017-06-07 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80988

--- Comment #5 from Thomas Koenig  ---
Simple test case:

$ cat swim.f90 
program main
  implicit none
  integer :: i,j
  integer, dimension(3,3) :: a
  a = reshape([(((i*10+j),i=1,3),j=1,3)], shape(a))
  print *,(a(i,i),i=1,3)
end program main
$ gfortran swim.f90 && ./a.out
  11  22  33
$ gfortran  -O swim.f90 && ./a.out
   0  -188758720   32767
$

[Bug lto/81004] linking failed with -flto

2017-06-07 Thread a3at.mail at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

--- Comment #2 from Azat  ---
> Does it fail when not using gold?

Yes

> Also which binutils version?

2.28.0.20170506

P.S. octoploid in #gcc helps to reduce it further

[Bug lto/81004] linking failed with -flto

2017-06-07 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

--- Comment #1 from Andrew Pinski  ---
Does it fail when not using gold?
Also which binutils version?

[Bug middle-end/81005] -fsanitize=null and -fsanitize=alignment doesn't check aggregate arguments of calls

2017-06-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81005

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-06-07
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Created attachment 41492
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41492&action=edit
gcc8-pr81005.patch

Untested fix.

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Wed Jun  7 15:43:35 2017
New Revision: 248989

URL: https://gcc.gnu.org/viewcvs?rev=248989&root=gcc&view=rev
Log:
PR libstdc++/81002 fix std::basic_regex range constructor

PR libstdc++/81002
* include/bits/regex.h (basic_regex): Adjust call to __compile_nfa
so iterator type is deduced.
* include/bits/regex_compiler.h (__compile_nfa): Reorder template
parameters to allow iterator type to be deduced.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.

Added:
trunk/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/regex.h
trunk/libstdc++-v3/include/bits/regex_compiler.h

[Bug middle-end/81005] New: -fsanitize=null and -fsanitize=alignment doesn't check aggregate arguments of calls

2017-06-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81005

Bug ID: 81005
   Summary: -fsanitize=null and -fsanitize=alignment doesn't check
aggregate arguments of calls
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

We don't instrument NULL pointer dereferences or misaligned aggregate loads for
aggregate arguments passed by value.

[Bug lto/81004] New: linking failed with -flto

2017-06-07 Thread a3at.mail at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004

Bug ID: 81004
   Summary: linking failed with -flto
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: a3at.mail at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

After upgrading to gcc 7.1 -flto build failed during linking, I tried to reduce
amount of involved sources, but this is what I got:
  https://github.com/azat-archive/gcc7-lto-linking-issue

For this you need:
- cmake
- boost program_options (I tried with 1.64)
- gcc 7.1
- libstdc++

(And I added Dockerfile/docker-compose if you are using it).

Of course this is not the desired testcase, so if I can make it shorter, I will
get back to you,

Thanks!

[Bug fortran/56386] [F03] ICE with ASSOCIATE construct and an derived type array component

2017-06-07 Thread vladimir.fuka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56386

Vladimir Fuka  changed:

   What|Removed |Added

Version|4.8.0   |7.1.1

--- Comment #6 from Vladimir Fuka  ---
Probably not a duplicate of pr64674 because this bug is still present in 7.1.1.

[Bug fortran/56386] [F03] ICE with ASSOCIATE construct and an derived type array component

2017-06-07 Thread vladimir.fuka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56386

--- Comment #5 from Vladimir Fuka  ---
Probably not a duplicate of pr64674 because this bug is still present in 7.1.1.

[Bug fortran/58618] ICE with character substring and ASSOCIATE

2017-06-07 Thread vladimir.fuka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58618

Vladimir Fuka  changed:

   What|Removed |Added

Version|4.8.0   |7.1.1

--- Comment #3 from Vladimir Fuka  ---
The wrong code is still in 7.1.1:

character(1) :: s(1)
s = "a"
print *, s(1)(1:1) 
associate (x=>s(1)(1:1))
  print *, x
end associate
  end


> gfortran-7 pr58618.f90 
> ./a.out
 a 
 �

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

--- Comment #27 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #22 from Daniel Santos  ---
[...]
> I thought I would post this here before posting to the list since I still 
> don't
> have a useable i686 build to test with.  Either way, I *think* all of the
> Solaris problems should be fixed.  This patch set addresses a number of other
> issues as well and ends with a proposed approach to tune parallelization.

Unfortunately, it doesn't:

* You missed one issue I had reported before:

FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p0\ -t64" (test
for excess errors)
Excess errors:
/var/gcc/regression/trunk/12-gcc/build/gcc/testsuite/gcc/ms-sysv/ms-sysv-generated.h:30:1:
error: bp cannot be used in asm here
Assembler: 
"/var/tmp//ccVdks6a.s", line 43 : Symbol "regs_to_mem" already has a
size

  Fixed like this:

diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S
b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S
--- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S
+++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S
@@ -90,7 +90,7 @@ FUNC_BEGIN(mem_to_regs)
mov 0xd0(%rax),%r14
mov 0xd8(%rax),%r15
retq
-FUNC_END(regs_to_mem)
+FUNC_END(mem_to_regs)

 # NOTE: Not MT safe
 FUNC_BEGIN(do_test_unaligned)

* Also as I'd reported before, with the fix above, I still get a couple
  of FAILures:

FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p0\ -t64" (test
for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p0\ -t64"
compilation failed to produce executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p0\ -t64" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p0\ -t64" compilation failed to produce executable
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p0\ -t64\
--omit-rbp-clobbers" (test for excess errors)
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p0\ -t64\
--omit-rbp-clobbers" execution test
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p0\ -t64\ --omit-rbp-clobbers" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p0\ -t64\ --omit-rbp-clobbers" compilation failed to produce
executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p1\ -t64" (test
for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p1\ -t64"
compilation failed to produce executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p1\ -t64" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p1\ -t64" compilation failed to produce executable
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p1\ -t64\
--omit-rbp-clobbers" (test for excess errors)
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p1\ -t64\
--omit-rbp-clobbers" execution test
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p1\ -t64\ --omit-rbp-clobbers" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p1\ -t64\ --omit-rbp-clobbers" compilation failed to produce
executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p5\ -t64" (test
for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p5\ -t64"
compilation failed to produce executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p5\ -t64" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p5\ -t64" compilation failed to produce executable
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p5\ -t64\
--omit-rbp-clobbers" (test for excess errors)
PASS: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O0 -g3 "-DGEN_ARGS=-p5\ -t64\
--omit-rbp-clobbers" execution test
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p5\ -t64\ --omit-rbp-clobbers" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3
"-DGEN_ARGS=-p5\ -t64\ --omit-rbp-clobbers" compilation failed to produce
executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p8\ -t64" (test
for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p8\ -t64"
compilation failed to produce executable
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p8\ -t64" (test for excess errors)
WARNING: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2
"-DGEN_ARGS=-p8\ -t64" compilation failed t

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #13 from Christophe Lyon  ---
(In reply to Richard Biener from comment #8)
> Author: rguenth
> Date: Wed Jun  7 09:10:17 2017
> New Revision: 248948
> 
> URL: https://gcc.gnu.org/viewcvs?rev=248948&root=gcc&view=rev
> Log:
> 2017-06-07  Richard Biener  
> 
>   PR tree-optimization/80928
>   * gcc.dg/vect/slp-perm-8.c: Avoid vectorizing loop computing
>   check_results.
> 
> Modified:
> trunk/gcc/testsuite/ChangeLog
> trunk/gcc/testsuite/gcc.dg/vect/slp-perm-8.c

After, arm and aarch64 regress:
FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects  scan-tree-dump-times
vect "vectorized 1 loops" 2
FAIL: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorized 1 loops" 2

but these improve:
PASS: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects  scan-tree-dump-times
vect "vectorizing stmts using SLP" 0
PASS: gcc.dg/vect/slp-perm-8.c scan-tree-dump-times vect "vectorizing stmts
using SLP" 0

[Bug tree-optimization/81003] [8 Regression] ICE: tree check: expected ssa_name, have integer_cst in optimize_range_tests_to_bit_test, at tree-ssa-reassoc.c:2782

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81003

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug tree-optimization/81003] [8 Regression] ICE: tree check: expected ssa_name, have integer_cst in optimize_range_tests_to_bit_test, at tree-ssa-reassoc.c:2782

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81003

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-07
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed, started with r248447.

[Bug libstdc++/77691] [7/8 regression] experimental/memory_resource/resource_adaptor.cc FAILs

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77691

--- Comment #7 from Rainer Orth  ---
Created attachment 41491
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41491&action=edit
test program

[Bug tree-optimization/81003] New: [8 Regression] ICE: tree check: expected ssa_name, have integer_cst in optimize_range_tests_to_bit_test, at tree-ssa-reassoc.c:2782

2017-06-07 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81003

Bug ID: 81003
   Summary: [8 Regression] ICE: tree check: expected ssa_name,
have integer_cst in optimize_range_tests_to_bit_test,
at tree-ssa-reassoc.c:2782
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-8.0.0-alpha20170604 snapshot ICEs when compiling the following snippet w/
-O2 (-Os, -O3, -Ofast):

unsigned int wb, ku;

void
px (void)
{
  for (ku = 0; ku < 13; ku += 2)
wb &= !!ku;
}

% gcc-8.0.0-alpha20170604 -O2 -c x3ir8l1z.c
during GIMPLE pass: reassoc
x3ir8l1z.c: In function 'px':
x3ir8l1z.c:4:1: internal compiler error: tree check: expected ssa_name, have
integer_cst in optimize_range_tests_to_bit_test, at tree-ssa-reassoc.c:2782
 px (void)
 ^~

[Bug libstdc++/77691] [7/8 regression] experimental/memory_resource/resource_adaptor.cc FAILs

2017-06-07 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77691

--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
I've digged a bit further now.  

Running the testcase under gdb, I find that p at the failing assertion
is 0x806fda8, i.e. not aligned to 16 bytes but to 8 bytes instead.  It's
ultimately returned from malloc in libsupc++/new_op.cc (operator new
(std::size_t sz)).

With test attached testcase and gcc 7.1.0, I find:

  alignof   long long   long double double _Complex
std::max_align_t

  i386   8   4   8  16
  amd64  8  16   8  16
  sparc  8   8   8   8
  sparcv98  16   8  16

However, this changed from gcc 6 to 7:

  i386/gcc6  8   4   8   8
  i386/gcc7  8   4   8  16

where the gcc6 value matches what one would expect from :

typedef struct {
#if defined(__clang__) || defined(__llvm__)
long long __clang_max_align_nonce1 _ALIGNMENT(long long);
long double __clang_max_align_nonce2 _ALIGNMENT(long, double);
#elif defined(__GNUC__)
long long __max_align_ll _ALIGNMENT(long, long);
long double __max_align_ld _ALIGNMENT(long, double);
#else
__ATOMIC long long __max_align_ll;
__ATOMIC long double __max_align_ld;

#if defined(__i386) || defined(__amd64)
__ATOMIC double __COMPLEX  __max_align_d;
#endif  /* defined(__i386) || defined(__amd64) */
#endif  /* defined(__clang__) || defined(__llvm__) */
} max_align_t;
#endif  /* _MAX_ALIGN_T */

Rainer

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

--- Comment #26 from Daniel Santos  ---
Created attachment 41490
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41490&action=edit
proposed fix v3 part 5

I'm currently running a few jobs to try to measure the difference in load
average and running time of tests.  I can think of a whole lot of better
solutions to this issue, but I suppose I will need to throw a few numbers out
there if I'm going to assert it's a problem.  With or without this last patch,
a lot of other problems should be solved.

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

--- Comment #25 from Daniel Santos  ---
Created attachment 41489
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41489&action=edit
proposed fix v3 part 4

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

--- Comment #24 from Daniel Santos  ---
Created attachment 41488
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41488&action=edit
proposed fix v3 part 3

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

--- Comment #23 from Daniel Santos  ---
Created attachment 41487
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41487&action=edit
proposed fix v3 part 2

[Bug testsuite/80759] gcc.target/x86_64/abi/ms-sysv FAILs

2017-06-07 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80759

Daniel Santos  changed:

   What|Removed |Added

  Attachment #41397|0   |1
is obsolete||
  Attachment #41398|0   |1
is obsolete||

--- Comment #22 from Daniel Santos  ---
Created attachment 41486
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41486&action=edit
proposed fix v3 part 1

Rainer,

I thought I would post this here before posting to the list since I still don't
have a useable i686 build to test with.  Either way, I *think* all of the
Solaris problems should be fixed.  This patch set addresses a number of other
issues as well and ends with a proposed approach to tune parallelization.

[Bug libstdc++/81002] std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-06-07
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Mine.

[Bug libstdc++/81002] New: std::basic_regex can't be constructed from non-contiguous iterators

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002

Bug ID: 81002
   Summary: std::basic_regex can't be constructed from
non-contiguous iterators
   Product: gcc
   Version: 5.4.1
Status: UNCONFIRMED
  Keywords: rejects-valid
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include 
#include 

int main()
{
std::forward_list l;
std::regex r(l.begin(), l.end());
}



In file included from /home/jwakely/gcc/5/include/c++/5.4.1/regex:60:0,
 from re.cc:1:
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h: In instantiation
of ‘std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename
_TraitsT::locale_type&, std::regex_constants::syntax_option_type) [with
_FwdIter = std::_Fwd_list_iterator; _TraitsT =
std::__cxx11::regex_traits;
std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT> =
std::shared_ptr > >;
typename _TraitsT::locale_type = std::locale]’:
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex.h:766:60:   required from
‘std::__cxx11::basic_regex< , 
>::basic_regex(_FwdIter, _FwdIter, std::__cxx11::basic_regex<
,  >::locale_type,
std::__cxx11::basic_regex< , 
>::flag_type) [with _FwdIter = std::_Fwd_list_iterator; _Ch_type = char;
_Rx_traits = std::__cxx11::regex_traits; std::__cxx11::basic_regex<
,  >::locale_type =
std::locale; std::__cxx11::basic_regex< ,
 >::flag_type =
std::regex_constants::syntax_option_type]’
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex.h:512:73:   required from
‘std::__cxx11::basic_regex< , 
>::basic_regex(_FwdIter, _FwdIter, std::__cxx11::basic_regex<
,  >::flag_type) [with _FwdIter
= std::_Fwd_list_iterator; _Ch_type = char; _Rx_traits =
std::__cxx11::regex_traits; std::__cxx11::basic_regex<
,  >::flag_type =
std::regex_constants::syntax_option_type]’
re.cc:7:36:   required from here
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: error: no
matching function for call to ‘__compile_nfa(const char*, const char*, const
locale_type&, std::regex_constants::syntax_option_type&)’
   return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc,
   ^
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:187:5: note:
candidate: template
std::__detail::__enable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename
_TraitsT::locale_type&, std::regex_constants::syntax_option_type)
 __compile_nfa(_FwdIter __first, _FwdIter __last,
 ^
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:187:5: note:  
template argument deduction/substitution failed:
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: note:  
couldn't deduce template parameter ‘_TraitsT’
   return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc,
   ^
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:199:5: note:
candidate: template
std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename
_TraitsT::locale_type&, std::regex_constants::syntax_option_type)
 __compile_nfa(_FwdIter __first, _FwdIter __last,
 ^
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:199:5: note:  
template argument deduction/substitution failed:
/home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: note:  
couldn't deduce template parameter ‘_TraitsT’
   return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc,
   ^

[Bug debug/81001] New: incorrect debug info for parameter that is const pointer to typedef of array

2017-06-07 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81001

Bug ID: 81001
   Summary: incorrect debug info for parameter that is const
pointer to typedef of array
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ian at airs dot com
  Target Milestone: ---

I am using a fairly recent trunk (SVN revision 248521).

Compiling this program gives me correct debug info:

typedef unsigned char Bar;
void foo(Bar* f){}// this works
void foo2(const Bar* f){} // this confuses cgo
void x() {
  foo(0);
  foo2(0);
}

Using readelf --debug=info, the debug info for foo's parameter is correctly
represented as a pointer to a typedef of unsigned char:

 <2>: Abbrev Number: 7 (DW_TAG_formal_parameter)
   DW_AT_name: f
   DW_AT_decl_file   : 1
   DW_AT_decl_line   : 2
   DW_AT_type: <0xb5>   
   DW_AT_location: 2 byte block: 91 68  (DW_OP_fbreg: -24)
 <2>: Abbrev Number: 0
 <1>: Abbrev Number: 8 (DW_TAG_pointer_type)
   DW_AT_byte_size   : 8
   DW_AT_type: <0x2d>   


<2d>: Abbrev Number: 2 (DW_TAG_typedef)
<2e>   DW_AT_name: Bar  
<32>   DW_AT_decl_file   : 1
<33>   DW_AT_decl_line   : 1
<34>   DW_AT_type: <0x3d>   

<3d>: Abbrev Number: 4 (DW_TAG_base_type)
<3e>   DW_AT_byte_size   : 1
<3f>   DW_AT_encoding: 8(unsigned char)

The debug info for foo2's parameter is also correctly represented as a pointer
to a const variant of the same typedef:

 <2><78>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<79>   DW_AT_name: f
<7b>   DW_AT_decl_file   : 1
<7c>   DW_AT_decl_line   : 3
<7d>   DW_AT_type: <0x85>   
<81>   DW_AT_location: 2 byte block: 91 68  (DW_OP_fbreg: -24)
 <2><84>: Abbrev Number: 0
 <1><85>: Abbrev Number: 8 (DW_TAG_pointer_type)
<86>   DW_AT_byte_size   : 8
<87>   DW_AT_type: <0x38>   

<38>: Abbrev Number: 3 (DW_TAG_const_type)
<39>   DW_AT_type: <0x2d>   

Compiling this similar program--changing the typedef from unsigned char to an
array of unsigned char--gives me incorrect debug info.

typedef unsigned char Bar[12];
void foo(Bar* f){}// this works
void foo2(const Bar* f){} // this confuses cgo
void x() {
  foo(0);
  foo2(0);
}

The debug info for foo's parameter is correct:

 <2>: Abbrev Number: 8 (DW_TAG_formal_parameter)
   DW_AT_name: f
   DW_AT_decl_file   : 1
   DW_AT_decl_line   : 2
   DW_AT_type: <0xc7>   
   DW_AT_location: 2 byte block: 91 68  (DW_OP_fbreg: -24)
 <2>: Abbrev Number: 0
 <1>: Abbrev Number: 9 (DW_TAG_pointer_type)
   DW_AT_byte_size   : 8
   DW_AT_type: <0x2d>   

<2d>: Abbrev Number: 2 (DW_TAG_typedef)
<2e>   DW_AT_name: Bar  
<32>   DW_AT_decl_file   : 1
<33>   DW_AT_decl_line   : 1
<34>   DW_AT_type: <0x38>   

<38>: Abbrev Number: 3 (DW_TAG_array_type)
<39>   DW_AT_type: <0x4f>   
<3d>   DW_AT_sibling : <0x48>   

<4f>: Abbrev Number: 5 (DW_TAG_base_type)
<50>   DW_AT_byte_size   : 1
<51>   DW_AT_encoding: 8(unsigned char)
<52>   DW_AT_name: (indirect string, offset: 0x86): unsigned char  

But the debug info for foo2's parameter is incorrect:

 <2><8a>: Abbrev Number: 8 (DW_TAG_formal_parameter)
<8b>   DW_AT_name: f
<8d>   DW_AT_decl_file   : 1
<8e>   DW_AT_decl_line   : 3
<8f>   DW_AT_type: <0x97>   
<93>   DW_AT_location: 2 byte block: 91 68  (DW_OP_fbreg: -24)
 <2><96>: Abbrev Number: 0
 <1><97>: Abbrev Number: 9 (DW_TAG_pointer_type)
<98>   DW_AT_byte_size   : 8
<99>   DW_AT_type: <0x38>   

As you can see, the debug info for foo2's parameter says that it is a pointer
to an array of unsigned char.  The const qualifier has been lost.  The fact
that it is a pointer to a typedef has been lost.  What we should see here is
something like we saw for the first program: the pointer type should refer to a
DW_TAG_const_type that refers to the DW_TAG_typedef.

[Bug target/80999] gcc 7.x: bus error from 8-bit access to 32-bit only register at -O2

2017-06-07 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80999

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
Use volatile here if you want always a 32bit access.

[Bug tree-optimization/70390] [6 Regression] internal compiler error: in copy_loop_close_phi_args, at graphite-isl-ast-to-gimple.c:2114

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70390
Bug 70390 depends on bug 80906, which changed state.

Bug 80906 Summary: [7 Regression] ICE in copy_loop_close_phi_args, at 
graphite-isl-ast-to-gimple.c:2094
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80906

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/80906] [7 Regression] ICE in copy_loop_close_phi_args, at graphite-isl-ast-to-gimple.c:2094

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80906

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED
  Known to fail||7.1.0

--- Comment #7 from Richard Biener  ---
Fixed.

[Bug tree-optimization/59859] [meta-bug] GRAPHITE issues

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59859
Bug 59859 depends on bug 80906, which changed state.

Bug 80906 Summary: [7 Regression] ICE in copy_loop_close_phi_args, at 
graphite-isl-ast-to-gimple.c:2094
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80906

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/80842] [7 Regression] ICE at -O3 on x86_64-linux-gnu in "set_lattice_value"

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80842

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED

--- Comment #6 from Richard Biener  ---
Fixed.

[Bug tree-optimization/80842] [7 Regression] ICE at -O3 on x86_64-linux-gnu in "set_lattice_value"

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80842

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 13:07:06 2017
New Revision: 248970

URL: https://gcc.gnu.org/viewcvs?rev=248970&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

Backport from mainline
2017-05-02  Richard Biener  

PR tree-optimization/80549
* tree-cfgcleanup.c (mfb_keep_latches): New helper.
(cleanup_tree_cfg_noloop): Create forwarders to known loop
headers if they do not have a preheader.

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

2017-05-19  Richard Biener  

PR c++/80593
* c-warn.c (strict_aliasing_warning): Do not warn for accesses
to alias-set zero memory.

* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

2017-05-26  Richard Biener  

PR tree-optimization/80842
* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
value.

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

2017-05-31  Richard Biener  

PR tree-optimization/80906
* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
and pass through iv_map.
(copy_bb_and_scalar_dependences): Adjust.
(translate_pending_phi_nodes): Likewise.
(copy_loop_close_phi_args): Handle code-generating IVs instead
of ICEing.

* gcc.dg/graphite/pr80906.c: New testcase.

2017-05-11  Richard Biener  

PR tree-optimization/80705
* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
bases are not vectorizable.

* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

Added:
   
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-2.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/graphite/pr80906.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80549.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80842.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/bb-slp-pr80705.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-warn.c
branches/gcc-7-branch/gcc/graphite-isl-ast-to-gimple.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
branches/gcc-7-branch/gcc/tree-cfgcleanup.c
branches/gcc-7-branch/gcc/tree-ssa-ccp.c
branches/gcc-7-branch/gcc/tree-vect-data-refs.c

[Bug c++/80593] [7 Regression] GCC 7, aligned_storage and “dereferencing type-punned pointer will break strict-aliasing rules”

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80593

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED
  Known to fail||7.1.0

--- Comment #12 from Richard Biener  ---
Fixed.

[Bug tree-optimization/80705] Incorrect code generated for profile counter updates due to SLP+LIM

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80705

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 13:07:06 2017
New Revision: 248970

URL: https://gcc.gnu.org/viewcvs?rev=248970&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

Backport from mainline
2017-05-02  Richard Biener  

PR tree-optimization/80549
* tree-cfgcleanup.c (mfb_keep_latches): New helper.
(cleanup_tree_cfg_noloop): Create forwarders to known loop
headers if they do not have a preheader.

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

2017-05-19  Richard Biener  

PR c++/80593
* c-warn.c (strict_aliasing_warning): Do not warn for accesses
to alias-set zero memory.

* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

2017-05-26  Richard Biener  

PR tree-optimization/80842
* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
value.

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

2017-05-31  Richard Biener  

PR tree-optimization/80906
* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
and pass through iv_map.
(copy_bb_and_scalar_dependences): Adjust.
(translate_pending_phi_nodes): Likewise.
(copy_loop_close_phi_args): Handle code-generating IVs instead
of ICEing.

* gcc.dg/graphite/pr80906.c: New testcase.

2017-05-11  Richard Biener  

PR tree-optimization/80705
* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
bases are not vectorizable.

* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

Added:
   
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-2.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/graphite/pr80906.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80549.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80842.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/bb-slp-pr80705.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-warn.c
branches/gcc-7-branch/gcc/graphite-isl-ast-to-gimple.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
branches/gcc-7-branch/gcc/tree-cfgcleanup.c
branches/gcc-7-branch/gcc/tree-ssa-ccp.c
branches/gcc-7-branch/gcc/tree-vect-data-refs.c

[Bug tree-optimization/80906] [7 Regression] ICE in copy_loop_close_phi_args, at graphite-isl-ast-to-gimple.c:2094

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80906

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 13:07:06 2017
New Revision: 248970

URL: https://gcc.gnu.org/viewcvs?rev=248970&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

Backport from mainline
2017-05-02  Richard Biener  

PR tree-optimization/80549
* tree-cfgcleanup.c (mfb_keep_latches): New helper.
(cleanup_tree_cfg_noloop): Create forwarders to known loop
headers if they do not have a preheader.

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

2017-05-19  Richard Biener  

PR c++/80593
* c-warn.c (strict_aliasing_warning): Do not warn for accesses
to alias-set zero memory.

* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

2017-05-26  Richard Biener  

PR tree-optimization/80842
* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
value.

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

2017-05-31  Richard Biener  

PR tree-optimization/80906
* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
and pass through iv_map.
(copy_bb_and_scalar_dependences): Adjust.
(translate_pending_phi_nodes): Likewise.
(copy_loop_close_phi_args): Handle code-generating IVs instead
of ICEing.

* gcc.dg/graphite/pr80906.c: New testcase.

2017-05-11  Richard Biener  

PR tree-optimization/80705
* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
bases are not vectorizable.

* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

Added:
   
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-2.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/graphite/pr80906.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80549.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80842.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/bb-slp-pr80705.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-warn.c
branches/gcc-7-branch/gcc/graphite-isl-ast-to-gimple.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
branches/gcc-7-branch/gcc/tree-cfgcleanup.c
branches/gcc-7-branch/gcc/tree-ssa-ccp.c
branches/gcc-7-branch/gcc/tree-vect-data-refs.c

[Bug c++/80593] [7 Regression] GCC 7, aligned_storage and “dereferencing type-punned pointer will break strict-aliasing rules”

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80593

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 13:07:06 2017
New Revision: 248970

URL: https://gcc.gnu.org/viewcvs?rev=248970&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

Backport from mainline
2017-05-02  Richard Biener  

PR tree-optimization/80549
* tree-cfgcleanup.c (mfb_keep_latches): New helper.
(cleanup_tree_cfg_noloop): Create forwarders to known loop
headers if they do not have a preheader.

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

2017-05-19  Richard Biener  

PR c++/80593
* c-warn.c (strict_aliasing_warning): Do not warn for accesses
to alias-set zero memory.

* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

2017-05-26  Richard Biener  

PR tree-optimization/80842
* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
value.

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

2017-05-31  Richard Biener  

PR tree-optimization/80906
* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
and pass through iv_map.
(copy_bb_and_scalar_dependences): Adjust.
(translate_pending_phi_nodes): Likewise.
(copy_loop_close_phi_args): Handle code-generating IVs instead
of ICEing.

* gcc.dg/graphite/pr80906.c: New testcase.

2017-05-11  Richard Biener  

PR tree-optimization/80705
* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
bases are not vectorizable.

* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

Added:
   
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-2.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/graphite/pr80906.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80549.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80842.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/bb-slp-pr80705.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-warn.c
branches/gcc-7-branch/gcc/graphite-isl-ast-to-gimple.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
branches/gcc-7-branch/gcc/tree-cfgcleanup.c
branches/gcc-7-branch/gcc/tree-ssa-ccp.c
branches/gcc-7-branch/gcc/tree-vect-data-refs.c

[Bug tree-optimization/80549] [7 Regression] wrong code at -O2 and -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (executable does not terminate)

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80549

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED

--- Comment #8 from Richard Biener  ---
Fixed.

[Bug tree-optimization/80549] [7 Regression] wrong code at -O2 and -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (executable does not terminate)

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80549

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 13:07:06 2017
New Revision: 248970

URL: https://gcc.gnu.org/viewcvs?rev=248970&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

Backport from mainline
2017-05-02  Richard Biener  

PR tree-optimization/80549
* tree-cfgcleanup.c (mfb_keep_latches): New helper.
(cleanup_tree_cfg_noloop): Create forwarders to known loop
headers if they do not have a preheader.

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

2017-05-19  Richard Biener  

PR c++/80593
* c-warn.c (strict_aliasing_warning): Do not warn for accesses
to alias-set zero memory.

* g++.dg/warn/Wstrict-aliasing-bogus-char-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-6.C: Adjust expected outcome.

2017-05-26  Richard Biener  

PR tree-optimization/80842
* tree-ssa-ccp.c (set_lattice_value): Always meet with the old
value.

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

2017-05-31  Richard Biener  

PR tree-optimization/80906
* graphite-isl-ast-to-gimple.c (copy_loop_close_phi_nodes): Get
and pass through iv_map.
(copy_bb_and_scalar_dependences): Adjust.
(translate_pending_phi_nodes): Likewise.
(copy_loop_close_phi_args): Handle code-generating IVs instead
of ICEing.

* gcc.dg/graphite/pr80906.c: New testcase.

2017-05-11  Richard Biener  

PR tree-optimization/80705
* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
bases are not vectorizable.

* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

Added:
   
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-2.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/graphite/pr80906.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80549.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr80842.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/bb-slp-pr80705.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-warn.c
branches/gcc-7-branch/gcc/graphite-isl-ast-to-gimple.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
branches/gcc-7-branch/gcc/tree-cfgcleanup.c
branches/gcc-7-branch/gcc/tree-ssa-ccp.c
branches/gcc-7-branch/gcc/tree-vect-data-refs.c

[Bug target/79975] SEGV in cc1 compiling gcc.dg/rtl/x86_64/final.c

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79975

Rainer Orth  changed:

   What|Removed |Added

 Target|i?86-pc-solaris2.*, |i?86-pc-solaris2.*,
   |amd64-pc-solaris2.* |amd64-pc-solaris2.*,
   ||x86_64-unknown-freebsd12.0,
   ||i386-apple-darwin11.4.2,
   ||i386-apple-darwin16.7.0

--- Comment #2 from Rainer Orth  ---
I'm seeing the same on gcc-testresults for Freebsd 12.0 and my own 32-bit
builds
(64-bit is currently broken) of Mac OS X 10.7 and macOS 10.12.

[Bug c++/81000] std::any improvement

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81000

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||missed-optimization
  Component|libstdc++   |c++

--- Comment #1 from Jonathan Wakely  ---
I don't think there's anything wrong with std::any, Clang produces the same
result when using std::any from libstdc++. So the difference is in the
compiler, not the library implementation.

[Bug libstdc++/81000] New: std::any improvement

2017-06-07 Thread nicolas_daniengels at yahoo dot com.br
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81000

Bug ID: 81000
   Summary: std::any improvement
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nicolas_daniengels at yahoo dot com.br
  Target Milestone: ---

The code:

#if __has_include()
#  include 
   using namespace std;
#elif __has_include()
#  include 
   using namespace std::experimental;
#endif

int f()
{
any a = 0.;
a = 10;
return any_cast(a);
}

Is not optimised away (-O[1, 2, 3]) since was add in back 5.1. Could it be
improved for this trivial case?

Comparative:
https://godbolt.org/g/sfDj0C

Thanks to all contributors of libstdc++! 
Nicolas Engels

[Bug rtl-optimization/80474] [6 regression] ipa-cp wrongly adding LO(symbol) twice

2017-06-07 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80474

--- Comment #12 from Eric Botcazou  ---
> Thanks Eric

You're welcome.  Can you confirm that the tentative patch fixes the original
bug in the program?  It does for the reduced testcase, but you never know.

[Bug c++/80990] cv-qualifiers ignored in variable definition using class template argument deduction

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80990

--- Comment #5 from Jonathan Wakely  ---
Fixed on trunk so far, I'd like to backport this to gcc-7-branch.

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #12 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
>> --- Comment #5 from Rainer Orth  ---
>> The patch also caused a couple of regressions on i386-pc-solaris2.12:
>> 
>> +FAIL: gcc.dg/vect/slp-perm-8.c (internal compiler error)
>> +FAIL: gcc.dg/vect/slp-perm-8.c (test for excess errors)
>> +FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (internal compiler
>> error
>> )
>> +FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (test for excess
>> errors)
>> +WARNING: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects compilation failed
>> to
>>  produce executable
>> +WARNING: gcc.dg/vect/slp-perm-8.c compilation failed to produce executable
>
> Can't reproduce with a cross.

I see the same in a i686-pc-linux-gnu build.

>> Excess errors:
>> during GIMPLE pass: vect
>> dump file: slp-perm-8.c.156t.vect
>> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/vect/slp-perm-8.c:25:5:
>> internal compiler error: in operator[], at vec.h:729
>> 0x8b58359 vec::operator[](unsigned int)
>> /vol/gcc/src/hg/trunk/local/gcc/vec.h:729
>> 0x8b58359 gimple_phi_arg_edge
>> /vol/gcc/src/hg/trunk/local/gcc/gimple.h:4398
>> 0x8b58359 dump_gimple_phi
>> /vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:2185
>> 0x8b5a668 print_gimple_stmt(__FILE*, gimple*, int, unsigned long long)
>> /vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:117
>> 0x8a254c5 dump_gimple_stmt(unsigned long long, unsigned long long, gimple*,
>> int)
>> /vol/gcc/src/hg/trunk/local/gcc/dumpfile.c:340
>> 0x90750dd vect_schedule_slp_instance
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3680
>> 0x9074f6f vect_schedule_slp_instance
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
>> 0x9074f6f vect_schedule_slp_instance
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
>> 0x9074f6f vect_schedule_slp_instance
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
>> 0x9075861 vect_schedule_slp(vec_info*)
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3834
>> 0x905a2ba vect_transform_loop(_loop_vec_info*)
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7151
>> 0x907b4e8 vectorize_loops()
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690
>> 
>>   32 and 64-bit x86
>
> That is, i686-linux with -m32 / -m64?  I see no issues on
> x86_64 with -m32 or -m64.

Both i386-pc-solaris2.12 and i686-pc-linux-gnu.  Haven't tried an x86_64
build yet.

>> +FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
>> -fpeel
>> -loops -ftracer -finline-functions  (internal compiler error)
>> +FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
>> -fpeel
>> -loops -ftracer -finline-functions  (test for excess errors)
>> +WARNING: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
>> -fp
>> eel-loops -ftracer -finline-functions  compilation failed to produce 
>> executable
>> +FAIL: libgomp.fortran/vla1.f90   -O3 -g  (internal compiler error)
>> +FAIL: libgomp.fortran/vla1.f90   -O3 -g  (test for excess errors)
>> +WARNING: libgomp.fortran/vla1.f90   -O3 -g  compilation failed to produce
>> execu
>> table
>> 
>>   and several more
>> 
>> Excess errors:
>> during GIMPLE pass: vect
>> /vol/gcc/src/hg/trunk/local/libgomp/testsuite/libgomp.fortran/vla1.f90:40:0:
>> internal compiler error: in vect_free_slp_tree, at tree-vect-slp.c:62
>> 0x90e874f vect_free_slp_tree
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:62
>> 0x90e859d vect_free_slp_tree
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
>> 0x90e859d vect_free_slp_tree
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
>> 0x90e859d vect_free_slp_tree
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
>> 0x90eb870 vect_free_slp_instance(_slp_instance*)
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:80
>> 0x90d5678 vect_transform_loop(_loop_vec_info*)
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7249
>> 0x90f6a48 vectorize_loops()
>> /vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690
>>
>>   64-bit x86

Also on both i386-pc-solaris2.12 -m64 and i686-pc-linux-gnu -m64.

Rainer

[Bug c/80999] New: gcc 7.x: bus error from 8-bit access to 32-bit only register at -O2

2017-06-07 Thread alberto.vignani at fastwebnet dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80999

Bug ID: 80999
   Summary: gcc 7.x: bus error from 8-bit access to 32-bit only
register at -O2
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alberto.vignani at fastwebnet dot it
  Target Milestone: ---

gcc armhf 7.x.x on linux, ARM i.Mx6

To access a 32-bit memory-mapped processor register and extract the lower 8
bits I used this code:

   void *ptr = {some value got from mmap /dev/mem}
   int value = *((unsigned *)ptr) & 0xff;

This produces the correct 32-bit memory access followed by masking on gcc6 and
gcc7 at -O0.
gcc6:
ldr r3, [r9, r7]@ MEM[(unsigned int *)ioc2_229], MEM[(unsigned
int *)ioc2_229]
uxtbr7, r2  @ mode, prephitmp_371

gcc7, -O0:
ldr r3, [r3]@ _216, MEM[(unsigned int *)ioc1_377]
uxtbr3, r3  @ tmp507, _216

With gcc7 at -O2 the code is optimized to a byte access by removing the
masking:
ldrbr7, [r2]@ zero_extendqisi2  @ mode, MEM[(unsigned
int *)ioc1_284]

But the hardware only accepts 32-bit accesses for that particular register and
throws a bus error.
This (over-)optimization is dangerous. Is there a way to constrain the access
width on a memory range?

[Bug rtl-optimization/80474] [6 regression] ipa-cp wrongly adding LO(symbol) twice

2017-06-07 Thread jan.smets at nokia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80474

--- Comment #11 from Jan Smets  ---
Thanks Eric

[Bug sanitizer/80998] New: Implement -fsanitize=pointer-overflow

2017-06-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80998

Bug ID: 80998
   Summary: Implement -fsanitize=pointer-overflow
   Product: gcc
   Version: 7.0
   URL: https://reviews.llvm.org/rL304459
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
marxin at gcc dot gnu.org, mpolacek at gcc dot gnu.org
  Target Milestone: ---

As LLVM recently did, we can also implement the same sanitizer:

https://wdtz.org/catching-pointer-overflow-bugs.html
https://reviews.llvm.org/D20322

[Bug c++/80990] cv-qualifiers ignored in variable definition using class template argument deduction

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80990

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Wed Jun  7 11:34:36 2017
New Revision: 248966

URL: https://gcc.gnu.org/viewcvs?rev=248966&root=gcc&view=rev
Log:
PR c++/80990 use cv-qualifiers in class template argument deduction

gcc/cp:

PR c++/80990
* pt.c (do_class_deduction): Build qualified type.

gcc/testsuite:

PR c++/80990
* g++.dg/cpp1z/class-deduction39.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/class-deduction39.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug sanitizer/80932] UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80932

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Marek Polacek  ---
Fixed.

[Bug c/80919] [7 Regression] ICE: Segmentation fault with -Wall when printing address of size 0 array

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80919

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Marek Polacek  ---
Fixed for 7 too.

[Bug c/80919] [7 Regression] ICE: Segmentation fault with -Wall when printing address of size 0 array

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80919

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Wed Jun  7 11:29:34 2017
New Revision: 248963

URL: https://gcc.gnu.org/viewcvs?rev=248963&root=gcc&view=rev
Log:
PR c/80919
* c-format.c (matching_type_p): Return false if any of the types
requires structural equality.

* gcc.dg/format/pr80919.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/format/pr80919.c
Modified:
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-format.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/80932] UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2

2017-06-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80932

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Wed Jun  7 11:19:40 2017
New Revision: 248961

URL: https://gcc.gnu.org/viewcvs?rev=248961&root=gcc&view=rev
Log:
PR sanitizer/80932
* fold-const.c (extract_muldiv_1) : Add
TYPE_OVERFLOW_WRAPS check. 

* c-c++-common/ubsan/pr80932.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/ubsan/pr80932.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog

[Bug bootstrap/80838] PGO/LTO bootstrapped compiler 5% slower than pure PGO bootstrapped one

2017-06-07 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80838

--- Comment #3 from Markus Trippelsdorf  ---
bootstrap-lto/PGO:

 Performance counter stats for 'g++ -Ofast -w tramp3d-v4.cpp' (10 runs):
  16381.906087  task-clock (msec) #0.998 CPUs utilized 
  ( +-  0.32% )
1,408  context-switches  #0.086
K/sec( +-  0.31% )  
 6  cpu-migrations#0.000 K/sec 
  ( +-  3.45% ) 
   270,871  page-faults   #0.017 M/sec  
63,434,476,091  cycles#3.872 GHz   
  ( +-  0.27% ) 
13,204,293,203  stalled-cycles-frontend   #   20.82% frontend cycles
idle ( +-  0.25% )  
13,046,634,059  stalled-cycles-backend#   20.57% backend cycles
idle  ( +-  0.03% ) 
76,669,663,652  instructions  #1.21  insn per cycle 
  #0.17  stalled cycles per
insn  ( +-  0.03% ) 
16,930,988,799  branches  # 1033.518 M/sec 
  ( +-  0.03% ) 
   619,469,535  branch-misses #3.66% of all branches   
  ( +-  0.16% ) 

  16.408429260 seconds time elapsed
 ( +-  0.31% )

pure PGO:

 Performance counter stats for 'g++ -Ofast -w tramp3d-v4.cpp' (10 runs):

  15688.921067  task-clock (msec) #0.998 CPUs utilized 
  ( +-  0.11% )
 1,345  context-switches  #0.086 K/sec 
  ( +-  0.10% )
 6  cpu-migrations#0.000 K/sec 
  ( +-  6.72% )
   269,717  page-faults   #0.017 M/sec  
60,747,706,165  cycles#3.872 GHz   
  ( +-  0.08% )
13,442,559,819  stalled-cycles-frontend   #   22.13% frontend cycles
idle ( +-  0.14% )
12,919,375,998  stalled-cycles-backend#   21.27% backend cycles
idle  ( +-  0.02% )  (83.31%)
73,128,792,903  instructions  #1.20  insn per cycle 
  #0.18  stalled cycles per
insn  ( +-  0.02% )
16,607,093,842  branches  # 1058.524 M/sec 
  ( +-  0.02% )
   617,220,915  branch-misses #3.72% of all branches   
  ( +-  0.17% )

  15.718059194 seconds time elapsed
 ( +-  0.11% )

[Bug sanitizer/80953] Support libsanitizer on Solaris

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80953

--- Comment #5 from Rainer Orth  ---
Created attachment 41484
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41484&action=edit
Merge libsanitizer from compiler-rt r304722

I've now completed a merge of llvm r304722 into gcc trunk libsanitizer.  Most
of
it was straightforward, but a couple of issues may save others work:

* Two bugs in sanitizer_common/sanitizer_symbolizer_libbacktrace.cc have
already
  been reported upstream: https://reviews.llvm.org/D33933

* In libubsan, __ubsan_handle_type_mismatch has been renamed to
  __ubsan_handle_type_mismatch_v1, and likewise for
__ubsan_handle_type_mismatch_abort__ubsan_handle_type_mismatch_v1_abort

  The sanitizer.def and ubsan.c changes reflect this.  Worse, however, 
  the former uptr Alignment member of ubsan/ubsan_handlers.h was changed to
  unsigned char LogAlignment.  This needs a corresponding gcc change to pass
  log2(align) instead of just align.

* Many (all) */float-cast-overflow-*.c tests FAILed initially because of a
  message change:

  runtime error: value -133 is outside the range of representable values of
type 'signed char'

  lost the leading "value"

With these gcc side changes, testresults on x86_64-pc-linux-gnu are identical
to those with current gcc trunk, with the exception of

+FAIL: c-c++-common/asan/pr63888.c   -O2  execution test
+FAIL: c-c++-common/asan/pr63888.c   -O2 -flto  execution test
+FAIL: c-c++-common/asan/pr63888.c   -O2 -flto -flto-partition=none  execution
t
est
+FAIL: c-c++-common/asan/pr63888.c   -O3 -g  execution test
+FAIL: c-c++-common/asan/pr63888.c   -Os  execution test

I get here

=
==4734==ERROR: AddressSanitizer: odr-violation (0x004009e0):
  [1] size=12 'CSWTCH.1'
/vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:8:3
  [2] size=12 'CSWTCH.3'
/vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:21:3
These globals were registered at these points:
  [1]:
#0 0x7f2c9c48fb88 in __asan_register_globals
/vol/gcc/src/hg/trunk/solaris-asan/libsanitizer/asan/asan_globals.cc:356
#1 0x40097c in __libc_csu_init
(/var/scratch/gcc/gcc-8.0.0-20170531/4.10.10-gcc-gas-gld-asan/gcc/testsuite/gcc17/pr63888.exe+0x40097c)

  [2]:
#0 0x7f2c9c48fb88 in __asan_register_globals
/vol/gcc/src/hg/trunk/solaris-asan/libsanitizer/asan/asan_globals.cc:356
#1 0x40097c in __libc_csu_init
(/var/scratch/gcc/gcc-8.0.0-20170531/4.10.10-gcc-gas-gld-asan/gcc/testsuite/gcc17/pr63888.exe+0x40097c)

==4734==HINT: if you don't care about these errors you may set
ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'CSWTCH.1' at
/vol/gcc/src/hg/trunk/solaris-asan/gcc/testsuite/c-c++-common/asan/pr63888.c:8:3
==4734==ABORTING

Someone who knows that code way better needs to look into this.

  Rainer

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 09:39:53 2017
New Revision: 248950

URL: https://gcc.gnu.org/viewcvs?rev=248950&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

PR tree-optimization/80928
* gcc.dg/vect/slp-13.c: Adjust patterns with vect_pack_trunc.
* gcc.dg/vect/slp-13-big-array.c: Likewise.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c
trunk/gcc/testsuite/gcc.dg/vect/slp-13.c

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #10 from rguenther at suse dot de  ---
On Wed, 7 Jun 2017, ro at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928
> 
> Rainer Orth  changed:
> 
>What|Removed |Added
> 
>  CC||ro at gcc dot gnu.org
> 
> --- Comment #5 from Rainer Orth  ---
> The patch also caused a couple of regressions on i386-pc-solaris2.12:
> 
> +FAIL: gcc.dg/vect/slp-perm-8.c (internal compiler error)
> +FAIL: gcc.dg/vect/slp-perm-8.c (test for excess errors)
> +FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (internal compiler
> error
> )
> +FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (test for excess
> errors)
> +WARNING: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects compilation failed
> to
>  produce executable
> +WARNING: gcc.dg/vect/slp-perm-8.c compilation failed to produce executable

Can't reproduce with a cross.

> Excess errors:
> during GIMPLE pass: vect
> dump file: slp-perm-8.c.156t.vect
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/vect/slp-perm-8.c:25:5:
> internal compiler error: in operator[], at vec.h:729
> 0x8b58359 vec::operator[](unsigned int)
> /vol/gcc/src/hg/trunk/local/gcc/vec.h:729
> 0x8b58359 gimple_phi_arg_edge
> /vol/gcc/src/hg/trunk/local/gcc/gimple.h:4398
> 0x8b58359 dump_gimple_phi
> /vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:2185
> 0x8b5a668 print_gimple_stmt(__FILE*, gimple*, int, unsigned long long)
> /vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:117
> 0x8a254c5 dump_gimple_stmt(unsigned long long, unsigned long long, gimple*,
> int)
> /vol/gcc/src/hg/trunk/local/gcc/dumpfile.c:340
> 0x90750dd vect_schedule_slp_instance
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3680
> 0x9074f6f vect_schedule_slp_instance
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
> 0x9074f6f vect_schedule_slp_instance
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
> 0x9074f6f vect_schedule_slp_instance
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
> 0x9075861 vect_schedule_slp(vec_info*)
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3834
> 0x905a2ba vect_transform_loop(_loop_vec_info*)
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7151
> 0x907b4e8 vectorize_loops()
> /vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690
> 
>   32 and 64-bit x86

That is, i686-linux with -m32 / -m64?  I see no issues on
x86_64 with -m32 or -m64.

> +FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
> -fpeel
> -loops -ftracer -finline-functions  (internal compiler error)
> +FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
> -fpeel
> -loops -ftracer -finline-functions  (test for excess errors)
> +WARNING: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
> -fp
> eel-loops -ftracer -finline-functions  compilation failed to produce 
> executable
> +FAIL: libgomp.fortran/vla1.f90   -O3 -g  (internal compiler error)
> +FAIL: libgomp.fortran/vla1.f90   -O3 -g  (test for excess errors)
> +WARNING: libgomp.fortran/vla1.f90   -O3 -g  compilation failed to produce
> execu
> table
> 
>   and several more
> 
> Excess errors:
> during GIMPLE pass: vect
> /vol/gcc/src/hg/trunk/local/libgomp/testsuite/libgomp.fortran/vla1.f90:40:0:
> internal compiler error: in vect_free_slp_tree, at tree-vect-slp.c:62
> 0x90e874f vect_free_slp_tree
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:62
> 0x90e859d vect_free_slp_tree
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
> 0x90e859d vect_free_slp_tree
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
> 0x90e859d vect_free_slp_tree
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
> 0x90eb870 vect_free_slp_instance(_slp_instance*)
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:80
> 0x90d5678 vect_transform_loop(_loop_vec_info*)
> /vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7249
> 0x90f6a48 vectorize_loops()
> /vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690
>
>   64-bit x86

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #9 from Richard Biener  ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #6)
> ... and also on sparc-sun-solaris2.12:
> 
> +FAIL: gcc.dg/vect/slp-13-big-array.c -flto -ffat-lto-objects 
> scan-tree-dump-ti
> mes vect "vectorizing stmts using SLP" 3
> +FAIL: gcc.dg/vect/slp-13-big-array.c scan-tree-dump-times vect "vectorizing
> stm
> ts using SLP" 3
> +FAIL: gcc.dg/vect/slp-13.c -flto -ffat-lto-objects  scan-tree-dump-times
> vect "
> vectorizing stmts using SLP" 3
> +FAIL: gcc.dg/vect/slp-13.c scan-tree-dump-times vect "vectorizing stmts
> using S
> LP" 3
> 
>   32 and 64-bit sparc

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/vect/slp-13.c:18:3: note: not
vectorized: relevant stmt not supported: _3 = (short unsigned int) i_316;
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/vect/slp-13.c:18:3: note:
removing SLP instance operations starting from: out[_1] = _4;

ok, it needs demotion, will fix.

[Bug gcov-profile/47618] Collecting multiple profiles and using all for PGO

2017-06-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47618

Martin Liška  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

--- Comment #15 from Martin Liška  ---
Adding Andrew, may I ask you for your opinion about suggested patch/approach?

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Wed Jun  7 09:10:17 2017
New Revision: 248948

URL: https://gcc.gnu.org/viewcvs?rev=248948&root=gcc&view=rev
Log:
2017-06-07  Richard Biener  

PR tree-optimization/80928
* gcc.dg/vect/slp-perm-8.c: Avoid vectorizing loop computing
check_results.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vect/slp-perm-8.c

[Bug fortran/80988] [8 Regression] 171_swim fails

2017-06-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80988

Richard Biener  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #4 from Richard Biener  ---
I can confirm the miscompare of SWIM7 (auxilary output file) with the ref input
with -ffrontend-optimize on x86_64 and no miscompare with
-fno-frontend-optimize.

The main difference seems to be

 {
-  integer(kind=4) D.4152;
-  unsigned int countm1.16;
-
-  D.4152 = mnmin;
-  i = 1;
-  countm1.16 = ((unsigned int) D.4152 + 4294967295) / 10;, if (D.4152 <=
0)
-{
-  goto L.47;
-};
-  while (1)
-{
-  {
-unsigned int countm1t.17;
-
-_gfortran_transfer_real_write (&dt_parm.15,
&unew[((integer(kind=8)
) i + -1) * 1336], 8);
-L.46:;
-if (dt_parm.15.common.flags & 3) goto L.47;
-i = i + 10;
-countm1t.17 = countm1.16;
-countm1.16 = countm1.16 + 4294967295;
-if (countm1t.17 == 0) goto L.47;
-  }
-}
-  L.47:;
+  integer(kind=8) D.4152;
+  integer(kind=8) D.4153;
+  integer(kind=8) D.4154;
+  struct array1_real(kind=8) parm.16;
+
+  D.4152 = (integer(kind=8)) mnmin;
+  D.4153 = MAX_EXPR <(D.4152 + -1) /[fl] 10, -1>;
+  D.4154 = (integer(kind=8)) i;
+  parm.16.dtype = 537;
+  parm.16.dim[0].lbound = 1;
+  parm.16.dim[0].ubound = D.4153 + 1;
+  parm.16.dim[0].stride = 10;
+  parm.16.data = (void *) &unew[(D.4154 + -1) * 1335];
+  parm.16.offset = (D.4154 + -1) * 1335 + -1336;
+  _gfortran_transfer_array_write (&dt_parm.15, &parm.16, 8, 0);
 }

corresponding to

  PARAMETER (N1=1335, N2=1335)
  COMMON  UNEW(N1,N2)
...
  WRITE(7,360) (UNEW(I,I),I=1,MNMIN,10)
  360 FORMAT(/' DIAGONAL ELEMENTS OF U ', //(8E15.7))

[Bug tree-optimization/80996] gcc.dg/vect/vect-multitypes-12.c XPASSes

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80996

Rainer Orth  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug tree-optimization/80996] New: gcc.dg/vect/vect-multitypes-12.c XPASSes

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80996

Bug ID: 80996
   Summary: gcc.dg/vect/vect-multitypes-12.c XPASSes
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
Target: sparc-sun-solaris2.12

Created attachment 41483
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41483&action=edit
32-bit sparc-sun-solaris2.12 vect-multitypes-12.c.156t.vect

Between 20170602 (r248816) and 20170603 (r248854), the
gcc.dg/vect/vect-multitypes-12.c
test began to XPASS on 32-bit sparc-sun-solaris2.12:

+XPASS: gcc.dg/vect/vect-multitypes-12.c -flto -ffat-lto-objects 
scan-tree-dump
-times vect "vectorized 1 loops" 1
+XPASS: gcc.dg/vect/vect-multitypes-12.c scan-tree-dump-times vect "vectorized
1
 loops" 1

I suspect one can simply remove the xfail ilp32 from the matching
scan-tree-dump-times.

  Rainer

[Bug target/80986] auto keyword variable lost its attributes

2017-06-07 Thread manjian2006 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80986

--- Comment #2 from linzj  ---
I have found the cause of this bug.
In 5.3, the function strip_typedefs only use
result = cp_build_type_attribute_variant (result, TYPE_ATTRIBUTES (t));
but in 6.3 remove_attributes prediction get invovled:
  if (TYPE_ATTRIBUTES (t))
{
  if (remove_attributes)
result = apply_identity_attributes (result, TYPE_ATTRIBUTES (t),
   remove_attributes);
  else
result = cp_build_type_attribute_variant (result, TYPE_ATTRIBUTES (t));
}
and unfortunately the pcs attribute is declared as
  { "pcs",  1, 1, false, true,  true,  arm_handle_pcs_attribute,
false },
which affects_type_identity field is set to false, cause
apply_identity_attributes
drop this attribute.

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #7 from Rainer Orth  ---
Created attachment 41482
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41482&action=edit
32-bit sparc-sun-solaris2.12 slp-13.c.156t.vect

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
... and also on sparc-sun-solaris2.12:

+FAIL: gcc.dg/vect/slp-13-big-array.c -flto -ffat-lto-objects 
scan-tree-dump-ti
mes vect "vectorizing stmts using SLP" 3
+FAIL: gcc.dg/vect/slp-13-big-array.c scan-tree-dump-times vect "vectorizing
stm
ts using SLP" 3
+FAIL: gcc.dg/vect/slp-13.c -flto -ffat-lto-objects  scan-tree-dump-times vect
"
vectorizing stmts using SLP" 3
+FAIL: gcc.dg/vect/slp-13.c scan-tree-dump-times vect "vectorizing stmts using
S
LP" 3

  32 and 64-bit sparc

[Bug tree-optimization/80928] SLP vectorization does not handle induction in outer loop vectorization

2017-06-07 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80928

Rainer Orth  changed:

   What|Removed |Added

 CC||ro at gcc dot gnu.org

--- Comment #5 from Rainer Orth  ---
The patch also caused a couple of regressions on i386-pc-solaris2.12:

+FAIL: gcc.dg/vect/slp-perm-8.c (internal compiler error)
+FAIL: gcc.dg/vect/slp-perm-8.c (test for excess errors)
+FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (internal compiler
error
)
+FAIL: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects (test for excess
errors)
+WARNING: gcc.dg/vect/slp-perm-8.c -flto -ffat-lto-objects compilation failed
to
 produce executable
+WARNING: gcc.dg/vect/slp-perm-8.c compilation failed to produce executable

Excess errors:
during GIMPLE pass: vect
dump file: slp-perm-8.c.156t.vect
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/vect/slp-perm-8.c:25:5:
internal compiler error: in operator[], at vec.h:729
0x8b58359 vec::operator[](unsigned int)
/vol/gcc/src/hg/trunk/local/gcc/vec.h:729
0x8b58359 gimple_phi_arg_edge
/vol/gcc/src/hg/trunk/local/gcc/gimple.h:4398
0x8b58359 dump_gimple_phi
/vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:2185
0x8b5a668 print_gimple_stmt(__FILE*, gimple*, int, unsigned long long)
/vol/gcc/src/hg/trunk/local/gcc/gimple-pretty-print.c:117
0x8a254c5 dump_gimple_stmt(unsigned long long, unsigned long long, gimple*,
int)
/vol/gcc/src/hg/trunk/local/gcc/dumpfile.c:340
0x90750dd vect_schedule_slp_instance
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3680
0x9074f6f vect_schedule_slp_instance
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
0x9074f6f vect_schedule_slp_instance
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
0x9074f6f vect_schedule_slp_instance
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3641
0x9075861 vect_schedule_slp(vec_info*)
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:3834
0x905a2ba vect_transform_loop(_loop_vec_info*)
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7151
0x907b4e8 vectorize_loops()
/vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690

  32 and 64-bit x86

+FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel
-loops -ftracer -finline-functions  (internal compiler error)
+FAIL: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel
-loops -ftracer -finline-functions  (test for excess errors)
+WARNING: libgomp.fortran/vla1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fp
eel-loops -ftracer -finline-functions  compilation failed to produce executable
+FAIL: libgomp.fortran/vla1.f90   -O3 -g  (internal compiler error)
+FAIL: libgomp.fortran/vla1.f90   -O3 -g  (test for excess errors)
+WARNING: libgomp.fortran/vla1.f90   -O3 -g  compilation failed to produce
execu
table

  and several more

Excess errors:
during GIMPLE pass: vect
/vol/gcc/src/hg/trunk/local/libgomp/testsuite/libgomp.fortran/vla1.f90:40:0:
internal compiler error: in vect_free_slp_tree, at tree-vect-slp.c:62
0x90e874f vect_free_slp_tree
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:62
0x90e859d vect_free_slp_tree
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
0x90e859d vect_free_slp_tree
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
0x90e859d vect_free_slp_tree
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:55
0x90eb870 vect_free_slp_instance(_slp_instance*)
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-slp.c:80
0x90d5678 vect_transform_loop(_loop_vec_info*)
/vol/gcc/src/hg/trunk/local/gcc/tree-vect-loop.c:7249
0x90f6a48 vectorize_loops()
/vol/gcc/src/hg/trunk/local/gcc/tree-vectorizer.c:690

  64-bit x86

[Bug tree-optimization/80974] [8 Regression] wrong code (generated code hangs) at -O2 on x86_64-linux-gnu

2017-06-07 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80974

Andrew Pinski  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #11 from Andrew Pinski  ---
*** Bug 80894 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/80894] [8 Regression] 456.hmmer in SPEC CPU 2006 is miscompiled

2017-06-07 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80894

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #9 from Andrew Pinski  ---
(In reply to Marc Glisse from comment #8)
> Hopefully the issue is the same as in PR 80974, which does have a testcase.

And it was according to my testing.

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

[Bug c++/80994] Misleading error message for missing template keyword

2017-06-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80994

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Jonathan Wakely  ---
We have a few bugs about this already.

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

  1   2   >