[Bug middle-end/71488] [6/7 Regression] Wrong code for vector comparisons with ivybridge and westmere targets

2016-06-13 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71488

--- Comment #2 from Marc Glisse  ---
Independently of the wrong code issue, we are generating pretty bad code on
Uros' testcase. It is full of operator delete(0) and operator new(0). The first
one we could drop, but the second one is forced by the C++ standard to allocate
at least one byte (or throw). It probably comes from the copy constructor of
valarray. And even when I help with the usual:
  __attribute__((returns_nonnull)) __typeof__(malloc) malloc;
  inline void* operator new(std::size_t n){return malloc(n);}
  inline void operator delete(void*p)noexcept{free(p);}
the .optimized dump still has things like
  MEM[(struct valarray *)_61]._M_data = _45;
  _46 = MEM[(struct valarray *)_61]._M_data;
because of how late other optimizations happened. Quite a common occurrence
with C++ code :-(

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

--- Comment #7 from Jakub Jelinek  ---
Fixed for 6.2+ so far.

[Bug bootstrap/71481] [7 regression] ICE during selftest: input.c: test_reading_source_line

2016-06-13 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71481

--- Comment #10 from David Malcolm  ---
(In reply to Bernd Edlinger from comment #7)
> (In reply to David Malcolm from comment #3)
> > Candidate patch: https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00755.html
> 
> BTW: this patch seems not to remove the tempfile again.

I took the liberty of adding an:
  unlink (filename);
to the version of the patch I committed (r237414) as per the "obvious" rule.

With your fix (as r237383) I believe this bug is fixed.  The remaining issue is
the discussion of what to do about LANG, but maybe that's for the mailing list.

[Bug bootstrap/71481] [7 regression] ICE during selftest: input.c: test_reading_source_line

2016-06-13 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71481

--- Comment #9 from David Malcolm  ---
Author: dmalcolm
Date: Mon Jun 13 21:20:10 2016
New Revision: 237414

URL: https://gcc.gnu.org/viewcvs?rev=237414=gcc=rev
Log:
PR bootstrap/71481: fix input.c selftest

gcc/ChangeLog:
PR bootstrap/71481
* input.c (selftest::test_reading_source_line): Avoid reading from
__FILE__ by creating a tempfile with known content and reading
from that instead.


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

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 13 21:08:36 2016
New Revision: 237412

URL: https://gcc.gnu.org/viewcvs?rev=237412=gcc=rev
Log:
PR sanitizer/71498
* c-gimplify.c (ubsan_walk_array_refs_r): Set *walk_subtrees = 0 on
all BIND_EXPRs, and on all BIND_EXPRs recurse also on BIND_EXPR_BODY.

* c-c++-common/ubsan/bounds-13.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/ubsan/bounds-13.c
Modified:
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 13 21:01:44 2016
New Revision: 237409

URL: https://gcc.gnu.org/viewcvs?rev=237409=gcc=rev
Log:
PR sanitizer/71498
* c-gimplify.c (ubsan_walk_array_refs_r): Set *walk_subtrees = 0 on
all BIND_EXPRs, and on all BIND_EXPRs recurse also on BIND_EXPR_BODY.

* c-c++-common/ubsan/bounds-13.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/ubsan/bounds-13.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-gimplify.c
trunk/gcc/testsuite/ChangeLog

[Bug preprocessor/71183] [7 Regression] gcc -E always gives __DATE__ and __TIME__ as Jan 1 1970 00:00:00

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71183

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 13 21:00:07 2016
New Revision: 237408

URL: https://gcc.gnu.org/viewcvs?rev=237408=gcc=rev
Log:
PR preprocessor/71183
* c-ppoutput.c (init_pp_output): Set cb->get_source_date_epoch
to cb_get_source_date_epoch.

* gcc.dg/cpp/source_date_epoch-3.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/cpp/source_date_epoch-3.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-ppoutput.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/71403] [7 Regression] wrong code (segfault) at -O3 on x86_64-linux-gnu

2016-06-13 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71403

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #9 from Jeffrey A. Law  ---
Fixed on the trunk.

[Bug tree-optimization/71403] [7 Regression] wrong code (segfault) at -O3 on x86_64-linux-gnu

2016-06-13 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71403

--- Comment #8 from Jeffrey A. Law  ---
Author: law
Date: Mon Jun 13 20:55:59 2016
New Revision: 237403

URL: https://gcc.gnu.org/viewcvs?rev=237403=gcc=rev
Log:
PR tree-optimization/71403
* tree-ssa-threadbackward.c
(convert_and_register_jump_thread_path): No longer accept reference
to path.  Do not pop items off the path anymore.
(fsm_find_control_statement_thread_paths): Do not allow threading
to a deeper loop nest.  Pop the last item off the path here rather
than in convert_and_register_jump_thread_path.

PR tree-optimization/71403
* c-c++-common/ubsan/pr71403-1.c: New test.
* c-c++-common/ubsan/pr71403-2.c: New test.
* c-c++-common/ubsan/pr71403-3.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/ubsan/pr71403-1.c
trunk/gcc/testsuite/c-c++-common/ubsan/pr71403-2.c
trunk/gcc/testsuite/c-c++-common/ubsan/pr71403-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadbackward.c

[Bug middle-end/71488] [6/7 Regression] Wrong code for vector comparisons with ivybridge and westmere targets

2016-06-13 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71488

Uroš Bizjak  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
  Component|target  |middle-end
   Target Milestone|--- |7.0
Summary|Wrong code on GCC trunk |[6/7 Regression] Wrong code
   |with ivybridge and westmere |for vector comparisons with
   |targets |ivybridge and westmere
   ||targets
 Ever confirmed|0   |1

--- Comment #1 from Uroš Bizjak  ---
Following minimized case will show the problem:

--cut here--
int var_4 = 1;
long long var_9 = 0;

int main() {

  std::valarray v10;

  v10.resize(1);
  v10[0].resize(4);

  for (int i = 0; i < 4; i++)
v10[0][i] = ((var_9 == 0) > unsigned (var_4 == 0)) + (var_9 == 0);

  std::cout << v10[0][0] << "\n";
}
--cut here--

This test should be compiled with "-std=c++11 -O3 -march=westmere" to obtain
wrong result:

$ ./a.out
1

The correct result can be obtained by adding -fno-tree-vectorize to compile
flags:

./a.out
2

Looking at the asm dump, the problematic loop is:

.L22:
movddup var_9(%rip), %xmm0
pxor%xmm1, %xmm1
(1) pcmpeqq %xmm1, %xmm0
salq$63, %rax
movdqa  .LC0(%rip), %xmm2
sarq$63, %rax
movq%rax, %xmm1
(2) movdqa  %xmm0, %xmm3
punpcklqdq  %xmm1, %xmm1
pand%xmm2, %xmm0
shufps  $136, %xmm0, %xmm0
(3) pcmpgtq %xmm1, %xmm3
movdqa  %xmm3, %xmm1
pand%xmm2, %xmm1
shufps  $136, %xmm1, %xmm1
paddd   %xmm1, %xmm0
pmovsxdq%xmm0, %xmm1
psrldq  $8, %xmm0
pmovsxdq%xmm0, %xmm0
movups  %xmm1, (%rdx)
movups  %xmm0, 16(%rdx)

At insn (1), vector (0xf...f,0xf...f) is generated as a result of comparison of
vector (var_9,var_9) with vector (0,0). However, this result goes through insn
(2) directly to insn (3) as its input argument. This is certainly wrong, the
result of the comparison should be masked with (0x0...1,0x0...1).

The problem already exists at RTL expand time. The corresponding insn sequence
is:

;; mask__3.59_48 = vect_cst__51 == { 0, 0 };

(insn 117 116 118 (set (reg:V2DI 179)
(vec_duplicate:V2DI (reg:DI 108 [ var_9.0_50 ]))) crash.cpp:29 4210
{*vec_dupv2di}
 (nil))

(insn 118 117 119 (set (reg:V2DI 180)
(const_vector:V2DI [
(const_int 0 [0])
(const_int 0 [0])
])) crash.cpp:29 -1
 (nil))

(insn 119 118 120 (set (reg:V2DI 181)
(eq:V2DI (reg:V2DI 179)
(reg:V2DI 180))) crash.cpp:29 -1
 (nil))

(insn 120 119 0 (set (reg:V2DI 106 [ mask__3.59 ])
(reg:V2DI 181)) crash.cpp:29 -1
 (nil))

;; vect_patt_111.61_79 = VEC_COND_EXPR  vect_cst__63, { 1, 1 },
{ 0, 0 }>;

(insn 121 120 122 (set (reg:V2DI 182)
(vec_duplicate:V2DI (reg:DI 117 [ _64 ]))) 4210 {*vec_dupv2di}
 (nil))

(insn 122 121 123 (set (reg:V2DI 183)
(mem/u/c:V2DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [5  S16 A128]))
-1
 (expr_list:REG_EQUAL (const_vector:V2DI [
(const_int 1 [0x1])
(const_int 1 [0x1])
])
(nil)))

(insn 123 122 124 (set (reg:V2DI 184)
(gt:V2DI (reg:V2DI 106 [ mask__3.59 ])
(reg:V2DI 182))) -1
 (nil))

(insn 124 123 0 (set (reg:V2DI 119 [ vect_patt_111.61 ])
(and:V2DI (reg:V2DI 184)
(reg:V2DI 183))) -1
 (nil))

Please note how the result of comparison from (insn 119) enters directly a
foolow up comparison (insn 123). It looks to me that (insn 120) needs to be AND
insn, as is the case with comparison (insn 123) and its corresponding (insn
124).

Confirmed as a middle-end problem.

[Bug tree-optimization/71478] [7 Regression] ICE in tree-ssa-reassoc.c after r236564

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71478

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 13 18:54:25 2016
New Revision: 237392

URL: https://gcc.gnu.org/viewcvs?rev=237392=gcc=rev
Log:
PR middle-end/71478
* gcc.dg/pr71478.c: Remove dg-require-effective-target vect_int.
Add -Wno-psabi -w to dg-options.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr71478.c

[Bug middle-end/71524] [7 Regression] internal compiler error: in binds_to_current_def_p, at symtab.c:2232

2016-06-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71524

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 CC||hubicka at ucw dot cz
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
It is caused by r70018.

[Bug tree-optimization/71490] [7 regression] gcc.dg/tree-ssa/slsr-8.c FAILs

2016-06-13 Thread thopre01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71490

--- Comment #3 from Thomas Preud'homme  ---
Differences start at sink phase:

@@ -46,17 +56,17 @@ f (int s, int * c)
   _2 = a1.0_1 * 4;
   _3 = -_2;
   x1_14 = c_13(D) + _3;
-  a2_15 = s_11(D) * 4;
-  a2.1_4 = (unsigned int) a2_15;
-  _5 = a2.1_4 * 4;
-  _6 = -_5;
-  x2_16 = c_13(D) + _6;
   if (x1_14 != 0B)
 goto ;
   else
 goto ;

   :
+  a2_15 = s_11(D) * 4;
+  a2.1_4 = (unsigned int) a2_15;
+  _5 = a2.1_4 * 4;
+  _6 = -_5;
+  x2_16 = c_13(D) + _6;
   goto ;

   :

[Bug fortran/71523] Static variables given automatic initializers with -finit-* and -fmax-stack-var-size

2016-06-13 Thread fritzoreese at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71523

Fritz Reese  changed:

   What|Removed |Added

 CC||fritzoreese at gmail dot com

--- Comment #1 from Fritz Reese  ---
Created attachment 38697
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38697=edit
Patch for pr71523

Patch submitted, see https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html

[Bug middle-end/71524] New: [7 Regression] internal compiler error: in binds_to_current_def_p, at symtab.c:2232

2016-06-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71524

Bug ID: 71524
   Summary: [7 Regression] internal compiler error: in
binds_to_current_def_p, at symtab.c:2232
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

[hjl@gnu-13 gcc]$ cat /tmp/x.c
static int implementation2 (void)
{
  return 2;
}

static void *resolver2 (void)
{
  return (void *)implementation2;
}

static int func2 (void) __attribute__ ((ifunc ("resolver2")));

void *
get_func2 (void)
{
  return 
}

int
call_func2 (void)
{
  if (get_func2 () != )
__builtin_abort ();

  return func2 ();
}
[hjl@gnu-13 gcc]$ ./xgcc -B./ -m32 -O3 -S /tmp/x.c -o /tmp/x.s 
func2/2 (func2) @0x7f7ce5b892e0
  Type: function definition analyzed alias
  Visibility: prevailing_def_ironly
  Address is taken.
  References: resolver2/1 (alias)
  Referring: get_func2/3 (addr)
  Availability: overwritable
  First run: 0
  Function flags:
  Called by: call_func2/4 (1.00 per call) 
  Calls: 
/tmp/x.c:26:1: internal compiler error: in binds_to_current_def_p, at
symtab.c:2232
 }
 ^
0x7469bc symtab_node::binds_to_current_def_p(symtab_node*)
../../src-trunk/gcc/symtab.c:2232
0x126c68f worse_state
../../src-trunk/gcc/ipa-pure-const.c:477
0x126c68f propagate_pure_const
../../src-trunk/gcc/ipa-pure-const.c:1343
0x126c68f execute
../../src-trunk/gcc/ipa-pure-const.c:1676
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
[hjl@gnu-13 gcc]$

[Bug middle-end/71373] Handle more OMP_CLAUSE_* in nested function decomposition

2016-06-13 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71373

--- Comment #9 from Thomas Schwinge  ---
Author: tschwinge
Date: Mon Jun 13 16:37:29 2016
New Revision: 237386

URL: https://gcc.gnu.org/viewcvs?rev=237386=gcc=rev
Log:
[PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c

gcc/
PR middle-end/71373
* tree-nested.c (convert_nonlocal_omp_clauses)
(convert_local_omp_clauses): Document missing OMP_CLAUSE_*.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-nested.c

[Bug fortran/71523] New: Static variables given automatic initializers with -finit-* and -fmax-stack-var-size

2016-06-13 Thread fritzoreese at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71523

Bug ID: 71523
   Summary: Static variables given automatic initializers with
-finit-* and -fmax-stack-var-size
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fritzoreese at gmail dot com
  Target Milestone: ---

This bug is similar to pr41860. When a variable becomes static due to being
larger than -fmax-stack-var-size, the variable is still given an automatic
initializer on entry to its namespace by the -finit-* flags (-finit-integer,
-finit-local-zero, etc...)

This is probably an oversight due to the fact that the initializers are
generated at resolution time in resolve.c, but the size of the variable is not
known until translation time (in trans-decl.c).

S.A. the thread at https://gcc.gnu.org/ml/fortran/2016-06/msg00023.html

[Bug c++/70507] integer overflow builtins not constant expressions

2016-06-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70507

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #6 from Martin Sebor  ---
r237238 lets GCC 7 accept the integer overflow built-ins in constant
expressions whenever their arguments are.

[Bug c/68120] can't easily deal with integer overflow at compile time

2016-06-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #8 from Martin Sebor  ---
r237238 lets GCC 7 accept the integer overflow built-ins in constant
expressions whenever their arguments are.

[Bug c++/71463] [6/7 regression] unexpected warning: ignoring function return attributes on template argument

2016-06-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71463

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.4.0
   Keywords||diagnostic
   Last reconfirmed||2016-06-13
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|"ignoring attributes on |[6/7 regression] unexpected
   |template argument" in -O1   |warning: ignoring function
   |and above   |return attributes on
   ||template argument
  Known to fail||6.1.0, 7.0

--- Comment #4 from Martin Sebor  ---
I looked into this a bit and I'm not sure the warning works quite as intended
in this case.

First, the warning doesn't say which of the attributes is ignored, and so when
multiple attributes are specified, it suggests that all of them are ignored. 
But tests with single attributes show that only some trigger the warning,
raising the question of whether the warning works correctly.

Second, it's unclear to me what purpose the warning is meant to serve in this
case.  Since a function attribute always applies to the instance of the
function it decorates and never affects its type the warning doesn't indicate
anything unusual or unexpected, and only serves to confuse users.  (In cases
where the function is declared in a system header it's also unclear how the
should be avoided.)

Looking at the history of the warning for the test case, it started with
r222530 committed to fix bug 50800 which has to do with type attributes, not
those of functions (or variables), and there is no test that verifies that it
should be issued for the case of functions (or variables).  I'm inclined to
agree that this is a bug.  Confirming as a 6/7 regression with the test case
below:

$ cat t.C && /home/msebor/build/gcc-6-branch/gcc/xgcc -B
/home/msebor/build/gcc-6-branch/gcc -S -Wall -Wextra -Wpedantic t.C
void* __attribute__ ((assume_aligned (32))) f0 ();
void* __attribute__ ((returns_nonnull)) f1 ();

void* __attribute__ ((const)) f2 ();
void* __attribute__ ((const, warn_unused_result)) f3 ();

template  struct S { };

S s0;
S s1;
S s2;   // no warning
S s3;   // which of the two attributes are ignored?
t.C:9:17: warning: ignoring attributes on template argument ‘void* (*)()’
[-Wignored-attributes]
 S s0;
 ^
t.C:10:17: warning: ignoring attributes on template argument ‘void* (*)()’
[-Wignored-attributes]
 S s1;
 ^
t.C:12:17: warning: ignoring attributes on template argument ‘void* (*)()’
[-Wignored-attributes]
 S s3;   // which of the two attributes are ignored?
 ^

[Bug c++/71516] [5/6/7 Regression] ICE on invalid C++ code (invalid use of forward declared type) on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71516

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 38696
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38696=edit
gcc7-pr71516.patch

Untested fix.

[Bug tree-optimization/71483] [7 Regression] g++ ICE at -O3 on valid code on x86_64-linux-gnu with “Floating point exception”

2016-06-13 Thread alahay01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71483

alahay01 at gcc dot gnu.org changed:

   What|Removed |Added

 CC||alahay01 at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |alahay01 at gcc dot 
gnu.org

--- Comment #2 from alahay01 at gcc dot gnu.org ---
Due to error when vectorizing a live SLP operation.

[Bug tree-optimization/71490] [7 regression] gcc.dg/tree-ssa/slsr-8.c FAILs

2016-06-13 Thread thopre01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71490

Thomas Preud'homme  changed:

   What|Removed |Added

 CC||thopre01 at gcc dot gnu.org

--- Comment #2 from Thomas Preud'homme  ---
The FAIL started at r237185.

[Bug bootstrap/71510] [7 Regression] Failed to bootstrap with --with-arch=corei7 --with-cpu=intel

2016-06-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510

--- Comment #4 from H.J. Lu  ---
(In reply to Richard Biener from comment #2)
> Created attachment 38694 [details]
> this probably fixes it (didnt' try to reproduce)

Yes, it fixes it.  Thanks.

[Bug tree-optimization/71520] Missing cross-jumping of switch cases

2016-06-13 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71520

Thomas Schwinge  changed:

   What|Removed |Added

 CC||tschwinge at gcc dot gnu.org

--- Comment #3 from Thomas Schwinge  ---
Out of interest, I've also started to look into GIMPLE_SWITCH issues a bit, at
the end of last week (low priority for me, though).  One of my test cases
should be similar to the one you're addressing with your patch; will test.

[Bug tree-optimization/71522] [5/6/7 Regression] Wrong optimization of memcpy through a var of type long double

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71522

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||4.9.3
   Target Milestone|--- |5.5
Summary|Wrong optimization of   |[5/6/7 Regression] Wrong
   |memcpy through a var of |optimization of memcpy
   |type long double|through a var of type long
   ||double
  Known to fail||5.1.0, 7.0

[Bug tree-optimization/71522] Wrong optimization of memcpy through a var of type long double

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71522

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
  Component|c   |tree-optimization

--- Comment #3 from Richard Biener  ---
So it goes "wrong" when transforming 

  long double d;
  __int128 unsigned _3;

  MEM[(char * {ref-all})] = 0x414141414141414141414141414141;
  _3 = MEM[(char * {ref-all})];

into SSA as

  d_9 = 4.35573826932891467758901725805789285479666446831741854231e+96;
  _3 = VIEW_CONVERT_EXPR<__int128 unsigned>(d_9);

similar as to how elsewhere we avoid using FP representation for what is
accessed as integers we should probably do so in update-address-taken
(otherwise FP normalization will apply via build_real and friends).

[Bug c/71522] Wrong optimization of memcpy through a var of type long double

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71522

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-06-13
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Mine.

[Bug c++/71513] [6/7 Regression] ICE on valid C++11 code (with alignas specifier) on x86_64-linux-gnu: Segmentation fault

2016-06-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71513

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org
  Known to fail||6.1.0, 7.0

--- Comment #2 from Martin Sebor  ---
The regression was introduced in the following change:

r232701 | jason | 2016-01-21 15:26:02 -0500 (Thu, 21 Jan 2016) | 5 lines

PR c++/43407
* decl.c (start_enum): Add attributes parameter.
* parser.c (cp_parser_enum_specifier): Pass it.
* pt.c (lookup_template_class_1): Pass it.
* cp-tree.h: Adjust.

[Bug c/71522] Wrong optimization of memcpy through a var of type long double

2016-06-13 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71522

--- Comment #1 from Alexander Cherepanov  ---
This is run on x86-64, sizeof(long double) == 16. The string literal is 15
letters 'A' and a terminating 0.

To get the same effect on x86-32 the string should be shortened by four 'A'.

[Bug c/71522] New: Wrong optimization of memcpy through a var of type long double

2016-06-13 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71522

Bug ID: 71522
   Summary: Wrong optimization of memcpy through a var of type
long double
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ch3root at openwall dot com
  Target Milestone: ---

Source code:

--
#include 
#include 

int main()
{
  long double d;
  char s[sizeof d];

  memcpy(, "AAA", sizeof d);
  memcpy(, , sizeof s);

  printf("%s\n", s);
}
--

Results:

--
$ gcc -std=c11 -pedantic -Wall -Wextra test.c && ./a.out
AAA

$ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out

--

gcc version: gcc (GCC) 7.0.0 20160613 (experimental)

The effect is very similar to bug 71452 so, presumably, this also considered a
bug.

[Bug bootstrap/71510] [7 Regression] Failed to bootstrap with --with-arch=corei7 --with-cpu=intel

2016-06-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510

--- Comment #3 from H.J. Lu  ---
(In reply to Segher Boessenkool from comment #1)
> I cannot reproduce this problem; bootstrap went without a hitch, both
> with and without those --with-*.

Did you build i386 GCC or x86-64 GCC?

[Bug driver/68463] Offloading fails when some objects are compiled with LTO and some without

2016-06-13 Thread jnorris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68463

--- Comment #8 from jnorris at gcc dot gnu.org ---
Author: jnorris
Date: Mon Jun 13 13:17:22 2016
New Revision: 237379

URL: https://gcc.gnu.org/viewcvs?rev=237379=gcc=rev
Log:
Backport from mainline r236098.
2016-05-10  James Norris  

PR driver/68463
* config/rs6000/sysv4.h (CRTOFFLOADBEGIN): Define. Add
crtoffloadbegin.o
if offloading is enabled and -fopenacc or -fopenmp is specified.
(CRTOFFLOADEND): Likewise.
(STARTFILE_LINUX_SPEC): Add CRTOFFLOADBEGIN.
(ENDFILE_LINUX_SPEC): Add CRTOFFLOADEND.

Modified:
branches/gomp-4_0-branch/gcc/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/config/rs6000/sysv4.h

[Bug c/66682] Lots of macro expansion, very slow compilation

2016-06-13 Thread avibl at cadence dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66682

Avi Bloch  changed:

   What|Removed |Added

 CC||avibl at cadence dot com

--- Comment #10 from Avi Bloch  ---
(In reply to Mikhail Maltsev from comment #8)
> (In reply to Brendan G Bohannon from comment #7)
> > The code in question creates about 7k internal functions, which could be a
> > factor?
> Well, yes probably the number of functions does matter here. But again, this
> is a bug in GCC, which has been fixed in later versions (4.9.x and later).
> I can even point out the relevant commit. I prepared a slightly reduced
> testcase (all 6-argument thunks, ~2000 functions). Bisection shows that
> r208113 compiles the testcase in 7.5s (at -O0), while the previous revision
> requires 71 second (and over 6 minutes for full testcase).
> BTW, r208113 is a fix for PR60291 - a similar issue with C code which is
> generated by glasgow haskell compiler.

If I can't upgrade to a newer compiler, do you know if it's possible to get
around this problem by using specific gcc options?

Thanks

[Bug c++/71516] [5/6/7 Regression] ICE on invalid C++ code (invalid use of forward declared type) on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71516

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||jakub at gcc dot gnu.org
Summary|[7 Regression] ICE on   |[5/6/7 Regression] ICE on
   |invalid C++ code (invalid   |invalid C++ code (invalid
   |use of forward declared |use of forward declared
   |type) on x86_64-linux-gnu:  |type) on x86_64-linux-gnu:
   |Segmentation fault (program |Segmentation fault (program
   |cc1plus)|cc1plus)

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

[Bug c++/71515] [4.9/5/6/7 Regression] ICE on valid C++ code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71515

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
I bet this started with r148915 (at least, r148906 works, and r148977 ICEs with
infinite recursion).

[Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #3 from Richard Biener  ---
  :
  # RANGE [0, 2147483647] NONZERO 2147483647
  _2 = 1 / 0;
  # RANGE [0, 1073741823] NONZERO 1073741823
  iftmp.0_5 = _2 >> 1;
  if (iftmp.0_5 != 0)

so the testcase is somewhat artificial ... 

  /* For unsigned division when value ranges for dividend
 and divisor are available.  */
  if (vr1.type == VR_RANGE
  && !symbolic_range_p ()
  && !symbolic_range_p ())
min = int_const_binop (code, vr0.min, vr1.max);
  else
min = zero;

int_const_binop will return NULL_TREE for vr1.max == 0.

@@ -2938,7 +2944,8 @@ extract_range_from_binary_expr_1 (value_
 and divisor are available.  */
  if (vr1.type == VR_RANGE
  && !symbolic_range_p ()
- && !symbolic_range_p ())
+ && !symbolic_range_p ()
+ && compare_values (vr1.min, zero) != 0)
min = int_const_binop (code, vr0.min, vr1.max);
  else
min = zero;

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #8 from Richard Biener  ---
get_atomic_generic_size should be fixed instead it seems.

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

--- Comment #7 from Richard Biener  ---
The following ICEs

int a, b; 

int main (int n)
{
  int foo[n];
__atomic_exchange (, , , __ATOMIC_RELAXED);
  return 0; 
}

t.c:8:5: internal compiler error: in tree_to_uhwi, at tree.c:7343
 __atomic_exchange (, , , __ATOMIC_RELAXED);
 ^
0x11c50be tree_to_uhwi(tree_node const*)
/space/rguenther/src/svn/trunk/gcc/tree.c:7343
0x857a48 get_atomic_generic_size
/space/rguenther/src/svn/trunk/gcc/c-family/c-common.c:10988
0x857db1 resolve_overloaded_atomic_exchange
/space/rguenther/src/svn/trunk/gcc/c-family/c-common.c:11098
0x858594 resolve_overloaded_builtin(unsigned int, tree_node*, vec*)
/space/rguenther/src/svn/trunk/gcc/c-family/c-common.c:11394
0x7a0708 c_build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
/space/rguenther/src/svn/trunk/gcc/c/c-typeck.c:3150

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #4 from Jakub Jelinek  ---
Created attachment 38695
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38695=edit
gcc7-pr71498.patch

Patch I'm going to bootstrap/regtest.

[Bug c/71512] ICE: verify_gimple failed with UBSAN

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71512

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
$ ./cc1 -quiet pr44545.c -fsanitize=signed-integer-overflow
-fnon-call-exceptions -ftrapv -fexceptions
pr44545.c: In function ‘DrawChunk’:
pr44545.c:12:1: error: dead STMT in EH table
 }
 ^
_23 = numEnds_4 + 2;
pr44545.c:12:1: error: dead STMT in EH table
_30 = numEnds_4 + 2;
pr44545.c:12:1: error: dead STMT in EH table
_24 = _2 - 1;
pr44545.c:12:1: error: dead STMT in EH table
_28 = numEnds_4 + 2;
pr44545.c:12:1: error: dead STMT in EH table
_39 = x_38(D) - 5;
pr44545.c:12:1: error: dead STMT in EH table
_26 = numEnds_4 + 2;
pr44545.c:12:1: error: dead STMT in EH table
_32 = numEnds_4 + 2;
pr44545.c:12:1: error: dead STMT in EH table
_42 = x_40 + _20;
pr44545.c:12:1: internal compiler error: verify_gimple failed
0xdcd9e3 verify_gimple_in_cfg(function*, bool)
/home/marek/src/gcc/gcc/tree-cfg.c:5212
0xc6d4a5 execute_function_todo
/home/marek/src/gcc/gcc/passes.c:1964
0xc6c53c do_per_function
/home/marek/src/gcc/gcc/passes.c:1648
0xc6d684 execute_todo
/home/marek/src/gcc/gcc/passes.c:2016
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

--- Comment #3 from Jakub Jelinek  ---
That has been explained in the submission - walk_tree normally walks the
initializers of all vars mentioned in BIND_EXPR_VARS, including TREE_STATIC
ones, but obviously we don't want to instrument anything in the initializers of
TREE_STATIC decls.
That said, what the code actually does is obviously wrong, even if there are
any TREE_STATIC decls, we still want to walk the body of the BIND_EXPR, and for
the case that no decl has TREE_STATIC, we unnecessarily try to walk all the
DECL_INITIAL/DECL_SIZE* twice (it stops early, as it is a walk without
duplicates, but anyway).
So untested patch should fix this:

--- c-gimplify.c.jj 2016-01-27 19:47:27.0 +0100
+++ c-gimplify.c2016-06-13 13:27:06.531549561 +0200
@@ -67,23 +67,23 @@ ubsan_walk_array_refs_r (tree *tp, int *
 {
   hash_set *pset = (hash_set *) data;

-  /* Since walk_tree doesn't call the callback function on the decls
- in BIND_EXPR_VARS, we have to walk them manually.  */
   if (TREE_CODE (*tp) == BIND_EXPR)
 {
+  /* Since walk_tree doesn't call the callback function on the decls
+in BIND_EXPR_VARS, we have to walk them manually, so we can avoid
+instrumenting DECL_INITIAL of TREE_STATIC vars.  */
+  *walk_subtrees = 0;
   for (tree decl = BIND_EXPR_VARS (*tp); decl; decl = DECL_CHAIN (decl))
{
  if (TREE_STATIC (decl))
-   {
- *walk_subtrees = 0;
- continue;
-   }
+   continue;
  walk_tree (_INITIAL (decl), ubsan_walk_array_refs_r, pset,
 pset);
  walk_tree (_SIZE (decl), ubsan_walk_array_refs_r, pset, pset);
  walk_tree (_SIZE_UNIT (decl), ubsan_walk_array_refs_r, pset,
 pset);
}
+  walk_tree (_EXPR_BODY (*tp), ubsan_walk_array_refs_r, pset, pset);
 }
   else if (TREE_CODE (*tp) == ADDR_EXPR
   && TREE_CODE (TREE_OPERAND (*tp, 0)) == ARRAY_REF)

[Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521

Richard Biener  changed:

   What|Removed |Added

 CC||kugan at gcc dot gnu.org
   Target Milestone|--- |6.2

[Bug c++/71517] g++ gives different warnings if compiling a file directly or adding preprocess step

2016-06-13 Thread albert.astals at canonical dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71517

--- Comment #3 from Albert Astals Cid  ---
Ok, i see, this is regarding ccache bug
https://github.com/ccache/ccache/issues/93

[Bug c++/71511] [6/7 Regression] ICE on valid C++11 code (with decltype) on x86_64-linux-gnu: in cxx_incomplete_type_diagnostic, at cp/typeck2.c:567

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71511

--- Comment #3 from Marek Polacek  ---
Ah, that's just the gnu++14 change.

[Bug c++/71511] [6/7 Regression] ICE on valid C++11 code (with decltype) on x86_64-linux-gnu: in cxx_incomplete_type_diagnostic, at cp/typeck2.c:567

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71511

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
Started with r225272.

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

--- Comment #6 from Richard Biener  ---
Plus

Index: gcc/c-family/c-common.c
===
--- gcc/c-family/c-common.c (revision 237372)
+++ gcc/c-family/c-common.c (working copy)
@@ -11129,8 +11129,8 @@ resolve_overloaded_atomic_exchange (loca
   p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
   (*params)[0] = p0; 
   /* Convert new value to required type, and dereference it.  */
+  p1 = fold_convert (I_type_ptr, p1);
   p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
-  p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
   (*params)[1] = p1;

   /* Move memory model to the 3rd position, and end param list.  */

[Bug tree-optimization/71503] [7 Regression] gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition"

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71503

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
Started with r235808.

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #5 from Marek Polacek  ---
No, with r181031.

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

--- Comment #4 from Marek Polacek  ---
Might have started with 
commit 6e1c78b5ec698f92f4f8e461630b3f7a6234697e
Author: jakub 
Date:   Sun Nov 6 19:43:32 2011 +

* tree-cfg.c (gimple_can_merge_blocks_p): For -O0 don't remove
any user labels.


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

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #3 from Richard Biener  ---
gimplification:

case VIEW_CONVERT_EXPR:
  if (is_gimple_reg_type (TREE_TYPE (*expr_p))
  && is_gimple_reg_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0
{
  ret = gimplify_expr (_OPERAND (*expr_p, 0), pre_p,
   post_p, is_gimple_val, fb_rvalue);
  recalculate_side_effects (*expr_p);
  break;
}

fix:

Index: gcc/gimple-expr.h
===
--- gcc/gimple-expr.h   (revision 237372)
+++ gcc/gimple-expr.h   (working copy)
@@ -72,7 +72,7 @@ types_compatible_p (tree type1, tree typ
 static inline bool
 is_gimple_reg_type (tree type)
 {
-  return !AGGREGATE_TYPE_P (type);
+  return !AGGREGATE_TYPE_P (type) && !FUNC_OR_METHOD_TYPE_P (type);
 }

 /* Return true if T is a variable.  */


might eventually be worth to speeed up the type check by ordering tcc_type
entries in a particular way ...

[Bug tree-optimization/71416] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (vectorizable_live_operation)

2016-06-13 Thread alahay01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71416

alahay01 at gcc dot gnu.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from alahay01 at gcc dot gnu.org ---
Fixed.

[Bug tree-optimization/71416] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (vectorizable_live_operation)

2016-06-13 Thread alahay01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71416

--- Comment #9 from alahay01 at gcc dot gnu.org ---
Author: alahay01
Date: Mon Jun 13 11:07:35 2016
New Revision: 237375

URL: https://gcc.gnu.org/viewcvs?rev=237375=gcc=rev
Log:
2016-06-13  Alan Hayward  

gcc/
PR tree-optimization/71416
* tree-vect-loop.c (vectorizable_live_operation): Let worklist have
multiple entries


Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vect-loop.c

[Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521

--- Comment #2 from Marek Polacek  ---
Started with r225108.

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Problem is in function ubsan_walk_array_refs_r, where we skip all static
variables:

  /* Since walk_tree doesn't call the callback function on the decls
 in BIND_EXPR_VARS, we have to walk them manually.  */
  if (TREE_CODE (*tp) == BIND_EXPR)
{
  for (tree decl = BIND_EXPR_VARS (*tp); decl; decl = DECL_CHAIN (decl))
{
  if (TREE_STATIC (decl))
{
  *walk_subtrees = 0;
  continue;
}

where FUNCTION is a static var_decl:

(gdb) p debug_tree(decl)
 
unit size 
align 8 symtab 0 alias set -1 canonical type 0x768a6000
precision 8 min  max 
pointer_to_this >
BLK
size 
unit size 
align 8 symtab 0 alias set -1 canonical type 0x769e12a0
domain 
DI
size 
unit size 
align 64 symtab 0 alias set -1 canonical type 0x769e1000
precision 64 min  max >
pointer_to_this >
readonly addressable used static BLK file pr71498.c line 5 col 22 size
 unit size 
align 8 context  initial >

I'm wondering why are static vars skipped?

[Bug c++/71517] g++ gives different warnings if compiling a file directly or adding preprocess step

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71517

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Preprocessing loses macro invocation context information, so such differences
are expected (use -Wsystem-headers if you want to see warnings regardless if
something comes from system headers or not, or better preprocess just with -E
-fdirectives-only so that such information is not lost).

[Bug bootstrap/71510] [7 Regression] Failed to bootstrap with --with-arch=corei7 --with-cpu=intel

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-06-13
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Created attachment 38694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38694=edit
this probably fixes it (didnt' try to reproduce)

[Bug tree-optimization/71518] [6/7 Regression] wrong code at -O3 on x86_64-linux-gnu in 64-bit mode (not in 32-bit mode)

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71518

Jakub Jelinek  changed:

   What|Removed |Added

 CC||ienkovich at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org

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

[Bug tree-optimization/71521] [6/7 Regression] Regression in GCC-7.0.0's optimizer

2016-06-13 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.4.1
   Keywords||missed-optimization
   Last reconfirmed||2016-06-13
 CC||ktkachov at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|Regression in GCC-7.0.0's   |[6/7 Regression] Regression
   |optimizer   |in GCC-7.0.0's optimizer
  Known to fail||6.1.0, 7.0

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed on aarch64 as well.

[Bug tree-optimization/71521] New: Regression in GCC-7.0.0's optimizer

2016-06-13 Thread ishiura-compiler at ml dot kwansei.ac.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71521

Bug ID: 71521
   Summary: Regression in GCC-7.0.0's optimizer
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ishiura-compiler at ml dot kwansei.ac.jp
  Target Milestone: ---

We compiled a program (A.c) by GCC-7.0.0 and GCC-5.2.1 with -O3 option.
GCC-5.2.1 performed better optimization than GCC-7.0.0.

(A.c)
int x = 1;

int main ()
{
int t = (1/(1>=x))>>1;
if (t != 0) __builtin_abort();
return 0;
}

+--++
|gcc-7.0.0.s (gcc-7.0.0 A.c -O3 -S)|gcc-5.2.1.s (gcc-5.2.1 A.c -O3 -S)  |
+--++
|main: |main:   |
|.LFB0:|.LFB0:  |
|.cfi_startproc|.cfi_startproc  |
|cmpl$1, x(%rip)   ||
|jle .L2   ||
|movl$1, %eax  ||
|xorl%ecx, %ecx||
|cltd  ||
|idivl   %ecx  ||
|testl   %eax, %eax||
|js  .L10  ||
|.L2:  ||
|xorl%eax, %eax|xorl%eax, %eax  |
|ret   |ret |
|.L10: ||
|subq$8, %rsp  ||
|.cfi_def_cfa_offset 16||
|callabort ||
|.cfi_endproc  |.cfi_endproc|
|.LFE0:|.LFE0:  |
|.size   main, .-main  |.size   main, .-main|
|  |.section.text.unl...|
|  |.LCOLDE0:   |
|  |.section.text.sta...|
|  |.LHOTE0:|
|.globl  x |.globl  x   |
|.data |.data   |
|.align 4  |.align 4|
+--++
|.size   x, 4  |.size   x, 4|
|x:|x:  |
|.long   1 |.long   1   |
|.ident  "GCC: (GNU) 7.0.0 ... |.ident  "GCC: (Ubuntu 5.2...|
|.section.note.GNU-... |.section.note.GNU...|
+--++


using built-in spacs.
COLLECT_GCC=gcc-7.0-0612
COLLECT_LTO_WRAPPER=/home/kota_kitaura/opt/gcc-7.0-0612/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
configure with: ../gcc/configure --prefix=/home/kota_kitaura/opt/gcc-7.0-0612
--program-suffix=-7.0-0612 --enable-languages=c
Thread model: posix
gcc version 7.0.0 20160612 (experimental) (GCC) 

Using built-in specs.
COLLECT_GCC=gcc-5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
5.2.1-23ubuntu1~15.10' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64

[Bug middle-end/71310] Bitfields cause load hit store with smaller store and larger load

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71310

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #9 from Richard Biener  ---
Mine.

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #9 from Richard Biener  ---
Fixed on active branches.

[Bug tree-optimization/71520] Missing cross-jumping of switch cases

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71520

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
Created attachment 38693
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38693=edit
gcc7-pr71520.patch

Untested fix for the first issue.

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Mon Jun 13 10:33:30 2016
New Revision: 237374

URL: https://gcc.gnu.org/viewcvs?rev=237374=gcc=rev
Log:
2016-06-13  Richard Biener  

PR tree-optimization/71505
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Make
assert match comment.

Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/tree-vect-data-refs.c

[Bug bootstrap/71510] [7 Regression] Failed to bootstrap with --with-arch=corei7 --with-cpu=intel

2016-06-13 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510

--- Comment #1 from Segher Boessenkool  ---
I cannot reproduce this problem; bootstrap went without a hitch, both
with and without those --with-*.

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Mon Jun 13 10:29:35 2016
New Revision: 237373

URL: https://gcc.gnu.org/viewcvs?rev=237373=gcc=rev
Log:
2016-06-13  Richard Biener  

PR tree-optimization/71505
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Make
assert match comment.

Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/tree-vect-data-refs.c

[Bug tree-optimization/71520] Missing cross-jumping of switch cases

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71520

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 Ever confirmed|0   |1

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

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Mon Jun 13 10:25:26 2016
New Revision: 237372

URL: https://gcc.gnu.org/viewcvs?rev=237372=gcc=rev
Log:
2016-06-13  Richard Biener  

PR tree-optimization/71505
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Make
assert match comment.

Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/tree-vect-data-refs.c

[Bug tree-optimization/71520] New: Missing cross-jumping of switch cases

2016-06-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71520

Bug ID: 71520
   Summary: Missing cross-jumping of switch cases
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

As mentioned in PR71373, for switch cases we have various issues.

One is that tree cross-jumping fails to handle bbs with labels, therefore
anything that is successfor of GIMPLE_SWITCH.

Another one is that the switchconv pass runs very early, before we could do any
cross-jumping, and therefore often decides to use inefficient table or bitmask
lowering, even when it could do better if it knew some cases can be
cross-jumped.

For the first issue, testcase is e.g.
void bar (int);

void
foo (int x)
{
  switch (x)
{
case 1:
case 12:
case 28:
case 174:
  bar (1);
  bar (2);
  break;
case 3:
case 7:
case 78:
case 96:
case 121:
default:
  bar (3);
  bar (4);
  bar (5);
  bar (6);
  break;
case 8:
case 13:
case 27:
case 19:
case 118:
  bar (3);
  bar (4);
  bar (5);
  bar (6);
  break;
case 4:
  bar (7);
  break;
}
}

[Bug target/61578] [4.9 regression] Code size increase for ARM thumb compared to 4.8.x when compiling with -Os

2016-06-13 Thread avieira at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61578

--- Comment #44 from avieira at gcc dot gnu.org ---
Author: avieira
Date: Mon Jun 13 10:03:30 2016
New Revision: 237371

URL: https://gcc.gnu.org/viewcvs?rev=237371=gcc=rev
Log:
Backport from Mainline
2015-09-25  Vladimir Makarov  

PR target/61578
* lra-constarints.c (match_reload): Check presence of the input pseudo
  in the output pseudo.

Modified:
branches/ARM/embedded-5-branch/gcc/ChangeLog.arm
branches/ARM/embedded-5-branch/gcc/lra-constraints.c

[Bug target/71519] New: "Out of range operand" bteqz inst generated by "casesi_internal_mips16_"

2016-06-13 Thread yszhou4tech at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71519

Bug ID: 71519
   Summary: "Out of range operand" bteqz inst generated by
"casesi_internal_mips16_"
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yszhou4tech at gmail dot com
  Target Milestone: ---

There is a big switch statement in pcre_exec.c bundled with erlang 17.5.  When
cross compiling it with GCC 5.3.0 with MIPS16 enabled, the generated assembly
code contains a bteqz instruction with out of range target label

```
mips-openwrt-linux-musl-gcc -c -Werror=return-type -Os -pipe -mno-branch-likely
-mips32r2 -mtune=24kc -g3 -fno-caller-saves -fno-plt -fhonour-copts
-Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float
-mips16 -minterlink-mips16 -iremap
/home/yousong/git-repo/lede/build_dir/target-mips_24kc_musl-1.1.14/otp_src_17.5:otp_src_17.5
-Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1
-Wl,-z,now -Wl,-z,relro -D_GNU_SOURCE
-I/home/yousong/git-repo/lede/build_dir/target-mips_24kc_musl-1.1.14/otp_src_17.5/erts/mips-openwrt-linux-gnu
-fno-tree-copyrename
-I/home/yousong/git-repo/lede/staging_dir/target-mips_24kc_musl-1.1.14/usr/include
-I/home/yousong/git-repo/lede/staging_dir/target-mips_24kc_musl-1.1.14/include
-I/home/yousong/git-repo/lede/staging_dir/toolchain-mips_24kc_gcc-5.3.0_musl-1.1.14/usr/include
-I/home/yousong/git-repo/lede/staging_dir/toolchain-mips_24kc_gcc-5.3.0_musl-1.1.14/include/fortify
-I/home/yousong/git-repo/lede/staging_dir/toolchain-mips_24kc_gcc-5.3.0_musl-1.1.14/include
-D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT
-DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o
/home/yousong/git-repo/lede/build_dir/target-mips_24kc_musl-1.1.14/otp_src_17.5/erts/emulator/pcre/obj/mips-openwrt-linux-gnu/opt/pcre_exec.o
/home/yousong/git-repo/lede/build_dir/target-mips_24kc_musl-1.1.14/otp_src_17.5/erts/emulator/pcre/pcre_exec.c
{standard input}: Assembler messages:
{standard input}:1946: Error: operand value out of range for instruction
```

The generated code are like the following

```
1944 .loc 1 848 0
1945 sltu$2, 156
1946 bteqz   $L125
1947 sll $3, $2, 2
1948 la  $2, $L127
1949 addu$3, $2, $3
1950 lw  $3, 0($3)
1951 addu$2, $2, $3
1952 j   $2
1953 .align  2
1954 .align  2
1955 $L127:
1956 .word   $L126-$L127
1957 .word   $L128-$L127
1958 .word   $L129-$L127
1959 .word   $L130-$L127
1960 .word   $L131-$L127
...
49207 $L125:
49208 $LBE2372 = .
49209 $LBB2374 = .
49210 .loc 1 6452 0
49211 lw  $16,0($16)
49212 $LVL4091 = .
```

[Bug target/61578] [4.9 regression] Code size increase for ARM thumb compared to 4.8.x when compiling with -Os

2016-06-13 Thread avieira at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61578

--- Comment #43 from avieira at gcc dot gnu.org ---
Author: avieira
Date: Mon Jun 13 09:58:34 2016
New Revision: 237369

URL: https://gcc.gnu.org/viewcvs?rev=237369=gcc=rev
Log:
Backport from Mainline
2015-09-01  Vladimir Makarov  

PR target/61578
* lra-lives.c (process_bb_lives): Process move pseudos with the
  same value for copies and preferences
* lra-constraints.c (match_reload): Create match reload pseudo
  with the same value from single dying input pseudo.

Modified:
branches/ARM/embedded-5-branch/gcc/ChangeLog.arm
branches/ARM/embedded-5-branch/gcc/lra-constraints.c
branches/ARM/embedded-5-branch/gcc/lra-lives.c

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Mon Jun 13 09:44:51 2016
New Revision: 237368

URL: https://gcc.gnu.org/viewcvs?rev=237368=gcc=rev
Log:
2016-06-13  Richard Biener  

PR tree-optimization/71505
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Make
assert match comment.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vect-data-refs.c

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-06-13
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #4 from Richard Biener  ---
I can see that the assert might trigger but can't reproduce it either with your
testcase.  A fix would be to make the assert match the comment (the group
is then split because of the step <= (init_b - init_a) test).

[Bug c++/71508] Huge memory usage on compiling with many types

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71508

Richard Biener  changed:

   What|Removed |Added

   Keywords||compile-time-hog

--- Comment #1 from Richard Biener  ---
Please attach preprocessed source.

[Bug tree-optimization/71509] Bitfield causes load hit store with larger store than load

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71509

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-06-13
 Depends on||71310
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71310
[Bug 71310] Bitfields cause load hit store with smaller store and larger load

[Bug c++/71511] [6/7 Regression] ICE on valid C++11 code (with decltype) on x86_64-linux-gnu: in cxx_incomplete_type_diagnostic, at cp/typeck2.c:567

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71511

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
  Known to work||5.3.0
   Target Milestone|--- |6.2
Summary|ICE on valid C++11 code |[6/7 Regression] ICE on
   |(with decltype) on  |valid C++11 code (with
   |x86_64-linux-gnu: in|decltype) on
   |cxx_incomplete_type_diagnos |x86_64-linux-gnu: in
   |tic, at cp/typeck2.c:567|cxx_incomplete_type_diagnos
   ||tic, at cp/typeck2.c:567

[Bug c/71512] ICE: verify_gimple failed with UBSAN

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71512

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
Summary|ICE: verify_gimple failed   |ICE: verify_gimple failed
   |libbacktrace could not find |with UBSAN
   |executable to open  |
 Ever confirmed|0   |1
  Known to fail||6.1.1, 7.0

--- Comment #1 from Richard Biener  ---
Confirmed also on trunk.

[Bug c++/71513] [6/7 Regression] ICE on valid C++11 code (with alignas specifier) on x86_64-linux-gnu: Segmentation fault

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71513

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
  Known to work||5.4.0
   Target Milestone|--- |6.2
Summary|ICE on valid C++11 code |[6/7 Regression] ICE on
   |(with alignas specifier) on |valid C++11 code (with
   |x86_64-linux-gnu:   |alignas specifier) on
   |Segmentation fault  |x86_64-linux-gnu:
   ||Segmentation fault

[Bug middle-end/71514] ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71514

Richard Biener  changed:

   What|Removed |Added

  Component|tree-optimization   |middle-end

--- Comment #2 from Richard Biener  ---
So the atomics code really produces

main ()
{
  void  () foo.0_1;
  unsigned char _2;
  int _3;
  unsigned char _4;
  char _5;

  :
  foo.0_1 = foo;
  _2 = VIEW_CONVERT_EXPR(foo.0_1);
  _3 = (int) _2;
  _4 = __atomic_exchange_1 (, _3, 0);
  _5 = (char) _4;
  b = _5;
  return 0;

}

which loads a function (to a temporary of function type which is even an SSA
name...)

The lowering is bogus in creating

foo.0_1 = foo;
_2 = VIEW_CONVERT_EXPR(foo.0_1);
_3 = (int) _2;
_4 = __atomic_exchange_1 (, _3, 0);

iff then it should have created

_2 = MEM_REF[];

and load a unsigned char from foo.  IMHO a gimplifier or FE issue.

[Bug middle-end/71476] ICE in gimplify_switch_expr with -Wswitch-unreachable

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71476

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/71515] [4.9/5/6/7 Regression] ICE on valid C++ code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71515

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
  Known to work||4.6.4
   Target Milestone|--- |4.9.4
Summary|ICE on valid C++ code on|[4.9/5/6/7 Regression] ICE
   |x86_64-linux-gnu:   |on valid C++ code on
   |Segmentation fault (program |x86_64-linux-gnu:
   |cc1plus)|Segmentation fault (program
   ||cc1plus)

[Bug c++/71516] [7 Regression] ICE on invalid C++ code (invalid use of forward declared type) on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71516

Richard Biener  changed:

   What|Removed |Added

   Keywords||error-recovery,
   ||ice-on-invalid-code
  Known to work||6.1.0
   Target Milestone|--- |7.0
Summary|ICE on invalid C++ code |[7 Regression] ICE on
   |(invalid use of forward |invalid C++ code (invalid
   |declared type) on   |use of forward declared
   |x86_64-linux-gnu:   |type) on x86_64-linux-gnu:
   |Segmentation fault (program |Segmentation fault (program
   |cc1plus)|cc1plus)

[Bug tree-optimization/71518] [6/7 Regression] wrong code at -O3 on x86_64-linux-gnu in 64-bit mode (not in 32-bit mode)

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71518

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Target||x86_64-*-*
   Target Milestone|--- |6.2
Summary|[6,7 Regression] wrong code |[6/7 Regression] wrong code
   |at -O3 on x86_64-linux-gnu  |at -O3 on x86_64-linux-gnu
   |in 64-bit mode (not in  |in 64-bit mode (not in
   |32-bit mode)|32-bit mode)

[Bug middle-end/71476] ICE in gimplify_switch_expr with -Wswitch-unreachable

2016-06-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71476

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Mon Jun 13 08:57:02 2016
New Revision: 237367

URL: https://gcc.gnu.org/viewcvs?rev=237367=gcc=rev
Log:
PR middle-end/71476
* gimplify.c (maybe_warn_switch_unreachable): Factored out of
gimplify_switch_expr.
(warn_switch_unreachable_r): New function.

* c-c++-common/Wswitch-unreachable-4.c: New test.
* gcc.dg/Wswitch-unreachable-2.c: New test.
* g++.dg/tm/jump1.C: Move dg-warning.

Added:
trunk/gcc/testsuite/c-c++-common/Wswitch-unreachable-4.c
trunk/gcc/testsuite/gcc.dg/Wswitch-unreachable-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/tm/jump1.C

[Bug target/71379] [7 regression] Bootstrap fail on S/390 32 bit starting with r236831

2016-06-13 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71379

--- Comment #5 from Andreas Krebbel  ---
Author: krebbel
Date: Mon Jun 13 08:50:38 2016
New Revision: 237366

URL: https://gcc.gnu.org/viewcvs?rev=237366=gcc=rev
Log:
S/390: Fix MAX_ARGS value.

Committed to GCC 5 and mainline branches.

gcc/ChangeLog:

2016-06-13  Andreas Krebbel  

Backport from mainline
2016-06-13  Andreas Krebbel  

PR target/71379
* config/s390/s390.c (s390_expand_builtin): Increase MAX_ARGS by
one.


Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/s390/s390.c

[Bug tree-optimization/71416] [7 Regression] ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (vectorizable_live_operation)

2016-06-13 Thread alahay01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71416

--- Comment #8 from alahay01 at gcc dot gnu.org ---
In my current checkout, there is no ICE on x86 or aarch64.

I've updated to latest head, and can now reproduce the ICE on x86 (but not on
aarch64).

Looks like there ends up being two stmts in the worklist.

Investigating

[Bug tree-optimization/71483] [7 Regression] g++ ICE at -O3 on valid code on x86_64-linux-gnu with “Floating point exception”

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71483

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug target/71379] [7 regression] Bootstrap fail on S/390 32 bit starting with r236831

2016-06-13 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71379

Andreas Krebbel  changed:

   What|Removed |Added

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

--- Comment #4 from Andreas Krebbel  ---
Fixed with the patches above.

[Bug tree-optimization/71503] [7 Regression] gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition"

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71503

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Confirmed.

[Bug target/71379] [7 regression] Bootstrap fail on S/390 32 bit starting with r236831

2016-06-13 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71379

--- Comment #3 from Andreas Krebbel  ---
Author: krebbel
Date: Mon Jun 13 08:37:31 2016
New Revision: 237365

URL: https://gcc.gnu.org/viewcvs?rev=237365=gcc=rev
Log:
S/390: Fix MAX_ARGS value.

gcc/ChangeLog:

2016-06-13  Andreas Krebbel  

Backport from mainline
2016-06-13  Andreas Krebbel  

PR target/71379
* config/s390/s390.c (s390_expand_builtin): Increase MAX_ARGS by
one.


Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/s390/s390.c

[Bug tree-optimization/71505] -O3 internal compiler error in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71505

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška  ---
Can't reproduce neither of test-cases, can you please provide output with added
'--verbose'?

[Bug target/71379] [7 regression] Bootstrap fail on S/390 32 bit starting with r236831

2016-06-13 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71379

--- Comment #2 from Andreas Krebbel  ---
Author: krebbel
Date: Mon Jun 13 08:34:45 2016
New Revision: 237364

URL: https://gcc.gnu.org/viewcvs?rev=237364=gcc=rev
Log:
S/390: Fix MAX_ARGS value.

gcc/ChangeLog:

2016-06-13  Andreas Krebbel  

PR target/71379
* config/s390/s390.c (s390_expand_builtin): Increase MAX_ARGS by
one.


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

[Bug target/71379] [7 regression] Bootstrap fail on S/390 32 bit starting with r236831

2016-06-13 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71379

Andreas Krebbel  changed:

   What|Removed |Added

  Component|tree-optimization   |target
   Assignee|law at redhat dot com  |krebbel at gcc dot 
gnu.org

--- Comment #1 from Andreas Krebbel  ---
Turned out this is just a stupid bug in the backend which now happens to get
detected.

[Bug tree-optimization/71503] [7 Regression] gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition"

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71503

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2016-6-13
 CC||marxin at gcc dot gnu.org
Summary|gcc ICE at -O3 on valid |[7 Regression] gcc ICE at
   |code on x86_64-linux-gnu in |-O3 on valid code on
   |"gen_phi_arg_condition" |x86_64-linux-gnu in
   ||"gen_phi_arg_condition"

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug tree-optimization/71518] [7 Regression] wrong code at -O3 on x86_64-linux-gnu in 64-bit mode (not in 32-bit mode)

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71518

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 CC||marxin at gcc dot gnu.org
Summary|wrong code at -O3 on|[7 Regression] wrong code
   |x86_64-linux-gnu in 64-bit  |at -O3 on x86_64-linux-gnu
   |mode (not in 32-bit mode)   |in 64-bit mode (not in
   ||32-bit mode)
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug bootstrap/71510] [7 Regression] Failed to bootstrap with --with-arch=corei7 --with-cpu=intel

2016-06-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug sanitizer/71498] ubsan bounds checking influenced by surrounding code

2016-06-13 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71498

Tobias Burnus  changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus  ---
Still occurs with current trunk. The same can be observed by the following;
passing a 'static const' string seems to inhibit the instrumentation.

int a[100];
extern void call(const char * fn);
int testje (int core)
{
   static const char FUNCTION[] = "testje";
   call(FUNCTION);
   return a[core];
}

[Bug tree-optimization/71506] ICE with libvpx with -floop-interchange: isl_constraint.c:627: expecting integer value

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71506

Martin Liška  changed:

   What|Removed |Added

  Component|c   |tree-optimization

--- Comment #2 from Martin Liška  ---
Current trunk, as well as GCC 6.1.1 works fine.

[Bug c/71506] ICE with libvpx with -floop-interchange: isl_constraint.c:627: expecting integer value

2016-06-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71506

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-13
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed on 5.3.1 with following back-trace:

#0  0x76aa2908 in raise () from /lib64/libc.so.6
#1  0x76aa3d5a in abort () from /lib64/libc.so.6
#2  0x77add04b in isl_handle_error () from /usr/lib64/libisl.so.15
#3  0x77ad62ba in isl_constraint_set_coefficient_val () from
/usr/lib64/libisl.so.15
#4  0x00ec1bf2 in build_linearized_memory_access (pdr=0x19fe790,
map=0x1a0d2c0) at ../../gcc/graphite-interchange.c:129
#5  pdr_stride_in_loop (pdr=0x19fe790, depth=0, stride=0x7fffd560) at
../../gcc/graphite-interchange.c:215
#6  memory_strides_in_loop_1 (loop=0x1a0fc10, depth=0, strides=0x7fffd670)
at ../../gcc/graphite-interchange.c:301
#7  0x00ec6caa in lst_interchange_profitable_p (depth2=,
depth1=, nest=0x1a0fc10) at ../../gcc/graphite-interchange.c:418
#8  lst_try_interchange_loops (loop2=, loop1=,
scop=) at ../../gcc/graphite-interchange.c:555
#9  lst_interchange_select_inner (scop=scop@entry=0x19fe550,
outer_father=outer_father@entry=0x1a0fc70, outer=outer@entry=0,
inner_father=inner_father@entry=0x1a0fc40) at
../../gcc/graphite-interchange.c:618
#10 0x00ec9941 in lst_interchange_select_outer
(scop=scop@entry=0x19fe550, loop=0x1a0fc40, outer=outer@entry=0) at
../../gcc/graphite-interchange.c:644
#11 0x00ec998e in lst_interchange_select_outer
(scop=scop@entry=0x19fe550, loop=0x1a0fc70, outer=outer@entry=0) at
../../gcc/graphite-interchange.c:654
#12 0x00ec99dc in scop_do_interchange (scop=scop@entry=0x19fe550) at
../../gcc/graphite-interchange.c:666
#13 0x00e228ab in apply_poly_transforms (scop=scop@entry=0x19fe550) at
../../gcc/graphite-poly.c:280
#14 0x00e1e0e9 in graphite_transform_loops () at
../../gcc/graphite.c:310
#15 0x00e1e561 in graphite_transforms (fun=) at
../../gcc/graphite.c:339
#16 (anonymous namespace)::pass_graphite_transforms::execute (this=, fun=) at ../../gcc/graphite.c:420
#17 0x00879216 in execute_one_pass (pass=pass@entry=0x19932e0) at
../../gcc/passes.c:2330
#18 0x00879646 in execute_pass_list_1 (pass=0x19932e0) at
../../gcc/passes.c:2383
#19 0x00879658 in execute_pass_list_1 (pass=0x1993280) at
../../gcc/passes.c:2384
#20 0x00879658 in execute_pass_list_1 (pass=0x1992e60) at
../../gcc/passes.c:2384
#21 0x00879658 in execute_pass_list_1 (pass=0x1991d20,
pass@entry=0x1991c60) at ../../gcc/passes.c:2384
#22 0x00879699 in execute_pass_list (fn=0x769f1690, pass=0x1991c60)
at ../../gcc/passes.c:2394
#23 0x0062dc8b in cgraph_node::expand (this=this@entry=0x76880498)
at ../../gcc/cgraphunit.c:1896
#24 0x0062ef74 in expand_all_functions () at
../../gcc/cgraphunit.c:2032
#25 symbol_table::compile (this=this@entry=0x76873000) at
../../gcc/cgraphunit.c:2385
#26 0x00630410 in symbol_table::compile (this=0x76873000) at
../../gcc/timevar.h:110
#27 symbol_table::finalize_compilation_unit (this=0x76873000) at
../../gcc/cgraphunit.c:2462
#28 0x004ce4d3 in cp_write_global_declarations () at
../../gcc/cp/decl2.c:4849
#29 0x0091d763 in compile_file () at ../../gcc/toplev.c:613
#30 0x0045f095 in do_compile () at ../../gcc/toplev.c:2067
#31 toplev::main (this=this@entry=0x7fffdad0, argc=argc@entry=17,
argv=argv@entry=0x7fffdbd8) at ../../gcc/toplev.c:2165
#32 0x0045fd8a in main (argc=17, argv=0x7fffdbd8) at
../../gcc/main.c:39

Reduced test-case 
$ cat tc.cc
enum enums { PLANE_TYPES };

typedef enums vp9_coeff_count[2][6][6][2];
typedef struct { vp9_coeff_count coef_counts[][PLANE_TYPES]; } RD_COUNTS;
struct A {
  RD_COUNTS rd_counts;
};
int accumulate_rd_opt_j, accumulate_rd_opt_k, accumulate_rd_opt_l,
accumulate_rd_opt_n, fn1_m;
A *fn1_td;
void fn1() {
  for (; fn1_m; fn1_m++) {
accumulate_rd_opt_n = 0;
for (; accumulate_rd_opt_n < 2; accumulate_rd_opt_n++)
  fn1_td->rd_counts
  .coef_counts[0][accumulate_rd_opt_j][accumulate_rd_opt_k]
  [accumulate_rd_opt_l][fn1_m][accumulate_rd_opt_n] =
PLANE_TYPES;
  }
}

  1   2   >