[Bug c/66826] New: Unused dlsym return results in segfault

2015-07-10 Thread quae at daurnimator dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826

Bug ID: 66826
   Summary: Unused dlsym return results in segfault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: quae at daurnimator dot com
  Target Milestone: ---

Having a weird issue here: if I dlsym() something in a constructor, but don't
use the result; the shared library segfaults at load.

bug-main.c:

#define _GNU_SOURCE
#include dlfcn.h

int main() {
void *foo = dlopen(./shared.so, RTLD_NOW);
void (*some_exported_function)() = dlsym(foo,
some_exported_function);
some_exported_function();
return 0;
}

bug-shared.c:

#define _GNU_SOURCE
#include dlfcn.h
#include stdio.h

static int (*pointer) ();
static int stub () { return 0; }
__attribute__((constructor)) static void some_init() {
if ((pointer = dlsym(RTLD_DEFAULT, anything)) == NULL) {
pointer = stub;
}
}

void some_exported_function() {
printf(in some_exported_function\n);
printf(%p\n, pointer);
}


Compile with:

gcc -shared -O2 -fPIC bug-shared.c -ldl -o shared.so
gcc -O2 -fPIC bug-main.c -ldl


Now comment out the `printf` of the pointer in bug-shared.c; and it'll get a
segfault.

Backtrace:
#0  0x77de4b77 in _dl_lookup_symbol_x () from
/lib64/ld-linux-x86-64.so.2
#1  0x77951b91 in do_sym () from /usr/lib/libc.so.6
#2  0x77bd80f4 in ?? () from /usr/lib/libdl.so.2
#3  0x77de9f94 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#4  0x77bd85e1 in ?? () from /usr/lib/libdl.so.2
#5  0x77bd8148 in dlsym () from /usr/lib/libdl.so.2
#6  0x77dea0ea in call_init.part () from /lib64/ld-linux-x86-64.so.2
#7  0x77dea1fb in _dl_init () from /lib64/ld-linux-x86-64.so.2
#8  0x77dee627 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#9  0x77de9f94 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#10 0x77dede01 in _dl_open () from /lib64/ld-linux-x86-64.so.2
#11 0x77bd7fc9 in ?? () from /usr/lib/libdl.so.2
#12 0x77de9f94 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#13 0x77bd85e1 in ?? () from /usr/lib/libdl.so.2
#14 0x77bd8061 in dlopen () from /usr/lib/libdl.so.2
#15 0x00400622 in main ()

$ gcc -dumpversion
5.1.0

Works fine with -O0
Works fine with clang


[Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt

2015-07-10 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

--- Comment #5 from vries at gcc dot gnu.org ---
https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00440.html:

Author: vries
Date: Fri Jul 10 08:25:18 2015
New Revision: 225655

URL: https://gcc.gnu.org/viewcvs?rev=225655root=gccview=rev
Log:
Insert new bound in try_transform_to_exit_first_loop_alt

2015-07-10  Tom de Vries  t...@codesourcery.com

* tree-parloops.c (try_transform_to_exit_first_loop_alt): If not found,
insert nit + 1 bound.

* testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: New 
test.
* testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: New test.

* gfortran.dg/parloops-exit-first-loop-alt-2.f95: New test.
* gfortran.dg/parloops-exit-first-loop-alt.f95: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/parloops-exit-first-loop-alt-2.f95
trunk/gcc/testsuite/gfortran.dg/parloops-exit-first-loop-alt.f95
trunk/libgomp/testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95
trunk/libgomp/testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-parloops.c
trunk/libgomp/ChangeLog


[Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt

2015-07-10 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

vries at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #6 from vries at gcc dot gnu.org ---
patch with test-case committed, resolving marked-fixed.


[Bug target/66703] [4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586 or on -miamcu

2015-07-10 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66703

--- Comment #4 from Uroš Bizjak ubizjak at gmail dot com ---
This patch makes testcase more robust:

--cut here--
Index: readeflags-1.c
===
--- readeflags-1.c  (revision 225648)
+++ readeflags-1.c  (working copy)
@@ -11,10 +11,11 @@
 #define EFLAGS_TYPE unsigned int
 #endif

-static EFLAGS_TYPE
+__attribute__((noinline, noclone))
+EFLAGS_TYPE
 readeflags_test (unsigned int a, unsigned int b)
 {
-  unsigned x = (a == b);
+  volatile char x = (a == b);
   return __readeflags ();
 }

--cut here--

[Bug other/66827] New: [6 Regression] left shifts of negative value warnings due to C++14 switch

2015-07-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66827

Bug ID: 66827
   Summary: [6 Regression] left shifts of negative value warnings
due to C++14 switch
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

For C++98 -fsanitize=undefined didn't warn in case of left shifts of negative
values.
Now that trunk switched to C++14 a number of new warnings popped up:

gcc/config/rs6000/rs6000.c:5398:36: runtime error: left shift of negative value
-12301
gcc/config/rs6000/rs6000.md:3126:17: runtime error: left shift of negative
value -1
gcc/dce.c:287:16: runtime error: ../../gcc/gcc/haifa-sched.c:1442:26:left shift
of negative value -1
gcc/expmed.c:3002:15: runtime error: left shift of negative value -1
gcc/haifa-sched.c:1164:24: runtime error: left shift of negative value -1
gcc/haifa-sched.c:1442:26: runtime error: left shift of negative value -1
gcc/hwint.h:250:19: runtime error: left shift of negative value -113824
gcc/real.c:2861:25: runtime error: left shift of negative value -63
gcc/sched-deps.c:112:20: runtime error: left shift of negative value -1
gcc/sreal.c:231:20: runtime error: left shift of negative value -1092263868
libcpp/files.c:683:30: runtime error: left shift of negative value -1
libiberty/regex.c:6970:11: runtime error: left shift of negative value -1
libiberty/regex.c:7165:4: runtime error: left shift of negative value -1


[Bug tree-optimization/66828] New: [5/6 Regression] gcc/tree-ssa-math-opts.c:2182:38: runtime error: left shift of 72057594037927936 by 8 places cannot be represented in type 'long int'

2015-07-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66828

Bug ID: 66828
   Summary: [5/6 Regression] gcc/tree-ssa-math-opts.c:2182:38:
runtime error: left shift of 72057594037927936 by 8
places cannot be represented in type 'long int'
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
CC: thomas.preudhomme at arm dot com
  Target Milestone: ---

since r219525 bootstrap-ubsan shows:

gcc/tree-ssa-math-opts.c:2182:38: runtime error: left shift of
72057594037927936 by 8 places cannot be represented in type 'long int'


[Bug target/66822] Turn -mtune=iamcu for size

2015-07-10 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66822

--- Comment #7 from Uroš Bizjak ubizjak at gmail dot com ---
(In reply to Uroš Bizjak from comment #3)
 Please hold a bit with this change, I have a patch that improves generation
 of zero_extend substantially.

Eh, it won't have such drastic effect on code size, so if size is priority,
X86_TUNE_ZERO_EXTEND_WITH_AND should be disabled.

[Bug tree-optimization/66823] -ftree-loop-if-convert-stores miscompiles gfortran.dg/elemental_optional_args_3.f90

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66823

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Fri Jul 10 07:53:06 2015
New Revision: 225652

URL: https://gcc.gnu.org/viewcvs?rev=225652root=gccview=rev
Log:
2015-07-10  Richard Biener  rguent...@suse.de

PR tree-optimization/66823
* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
inverted predicate.

* gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores
which should not be necessary.  XFAIL.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vect/pr61194.c
trunk/gcc/tree-if-conv.c


[Bug c++/66218] [c++-concepts] inconsistent deduction for ‘auto’ with a partial-concept-id in a deduction constraint

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66218

--- Comment #1 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 07:25:55 2015
New Revision: 225650

URL: https://gcc.gnu.org/viewcvs?rev=225650root=gccview=rev
Log:
PR c++/66218
* gcc/cp/pt.c (do_auto_deduction): Don't set TREE_TYPE (auto_node)
in requirement context.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req12.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/pt.c


[Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092

--- Comment #4 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 07:25:49 2015
New Revision: 225649

URL: https://gcc.gnu.org/viewcvs?rev=225649root=gccview=rev
Log:
PR c++/66092
* gcc/cp/cp-tree.h (concept_template_p): New.
* gcc/cp/pt.c (coerce_template_parms): Concepts are also affected
by DR 1430.
* gcc/cp/constraint.cc (lift_template_id): Use location_of.
* gcc/cp/parser.c (cp_parser_template_id): SET_EXPR_LOCATION.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/dr1430.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/constraint.cc
branches/c++-concepts/gcc/cp/cp-tree.h
branches/c++-concepts/gcc/cp/parser.c
branches/c++-concepts/gcc/cp/pt.c
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/var-concept3.C


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #2 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 07:26:01 2015
New Revision: 225651

URL: https://gcc.gnu.org/viewcvs?rev=225651root=gccview=rev
Log:
PR c++/66758
* gcc/cp/parser.c (cp_parser_requirement_parameter_list):Use grokparms.
* gcc/cp/constraint.cc (fixup_constraint_vars): Remove.
(tsubst_constraint_variables): Don't call it.
(declare_constraint_vars): Constraint vars aren't a TREE_LIST anymore.
(finish_requires_expr): Likewise.
* gcc/cp/cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
Likewise.
* gcc/cp/decl.c (grokparms): No longer static.
* gcc/cp/cp-tree.h: Declare it.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req13.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/constraint.cc
branches/c++-concepts/gcc/cp/cp-tree.h
branches/c++-concepts/gcc/cp/cxx-pretty-print.c
branches/c++-concepts/gcc/cp/decl.c
branches/c++-concepts/gcc/cp/parser.c


[Bug c++/65592] internal compiler error: Segmentation fault when using non-existent enum class enumerator

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65592

--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com ---
This issue is already fixed in mainline. I'm adding a testcase and closing it.


[Bug c++/65592] internal compiler error: Segmentation fault when using non-existent enum class enumerator

2015-07-10 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65592

--- Comment #4 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org ---
Author: paolo
Date: Fri Jul 10 09:33:34 2015
New Revision: 225658

URL: https://gcc.gnu.org/viewcvs?rev=225658root=gccview=rev
Log:
2015-07-10  Paolo Carlini  paolo.carl...@oracle.com

PR c++/65592
* g++.dg/cpp0x/scoped_enum6.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/scoped_enum6.C
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug c++/65592] internal compiler error: Segmentation fault when using non-existent enum class enumerator

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65592

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||paolo.carlini at oracle dot com
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com ---
Done.


[Bug fortran/66775] Allocatable function result type(t) produces segfault when uninitialized

2015-07-10 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66775

vehre at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #3 from vehre at gcc dot gnu.org ---
By sections 12.5.3 and 12.6.2.2 of F2008 the function has to return an
allocated object, this means this pr is invalid. Nothing broken, nothing to
fix.


[Bug target/66780] [4.9 Regression] Compiling with -fstack-protector-strong causes binary to segfault

2015-07-10 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66780

--- Comment #6 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
Author: kkojima
Date: Fri Jul 10 09:50:18 2015
New Revision: 225660

URL: https://gcc.gnu.org/viewcvs?rev=225660root=gccview=rev
Log:
PR target/66780
* config/sh/sh.md (symGOT_load): Revert a part of 2015-03-03
change for target/65249.


Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/sh/sh.md


[Bug target/66563] [4.9/5 Regression] ICE (segmentation fault) on sh4-linux-gnu

2015-07-10 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66563

--- Comment #53 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
(In reply to Kazumoto Kojima from comment #52)
We are lucky:-)  The test for backport of PR66780 patch for gcc-5 was done
and we get a chance to commit it:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00819.html
All known patches are applied to 5-branch and 5.2-release.


[Bug tree-optimization/66794] [4.9/5 Regression] ICE at -O2 and -O3 on x86_64-linux-gnu

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66794

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Fri Jul 10 12:33:28 2015
New Revision: 225671

URL: https://gcc.gnu.org/viewcvs?rev=225671root=gccview=rev
Log:
2015-07-10  Richard Biener  rguent...@suse.de

Backport from mainline
2015-07-10  Richard Biener  rguent...@suse.de

PR tree-optimization/66823
* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
inverted predicate.

* gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores
which should not be necessary.  XFAIL.

2015-07-08  Richard Biener  rguent...@suse.de

PR middle-end/43341
* toplev.c (compile_file): Reset maximum_field_alignment after parsing.

2015-07-08  Richard Biener  rguent...@suse.de

PR tree-optimization/66794
* gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
Free post-dominators.

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

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66794.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/gcc.dg/vect/pr61194.c
branches/gcc-5-branch/gcc/toplev.c
branches/gcc-5-branch/gcc/tree-if-conv.c


[Bug gcov-profile/43341] pragma pack changes padding in struct gcov_info on 64-bit archs

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43341

--- Comment #12 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Fri Jul 10 12:33:28 2015
New Revision: 225671

URL: https://gcc.gnu.org/viewcvs?rev=225671root=gccview=rev
Log:
2015-07-10  Richard Biener  rguent...@suse.de

Backport from mainline
2015-07-10  Richard Biener  rguent...@suse.de

PR tree-optimization/66823
* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
inverted predicate.

* gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores
which should not be necessary.  XFAIL.

2015-07-08  Richard Biener  rguent...@suse.de

PR middle-end/43341
* toplev.c (compile_file): Reset maximum_field_alignment after parsing.

2015-07-08  Richard Biener  rguent...@suse.de

PR tree-optimization/66794
* gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
Free post-dominators.

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

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66794.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/gcc.dg/vect/pr61194.c
branches/gcc-5-branch/gcc/toplev.c
branches/gcc-5-branch/gcc/tree-if-conv.c


[Bug target/66703] [4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586 or on -miamcu

2015-07-10 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66703

--- Comment #5 from H.J. Lu hjl.tools at gmail dot com ---
(In reply to Uroš Bizjak from comment #4)
 This patch makes testcase more robust:
 
 --cut here--
 Index: readeflags-1.c
 ===
 --- readeflags-1.c  (revision 225648)
 +++ readeflags-1.c  (working copy)
 @@ -11,10 +11,11 @@
  #define EFLAGS_TYPE unsigned int
  #endif
  
 -static EFLAGS_TYPE
 +__attribute__((noinline, noclone))
 +EFLAGS_TYPE
  readeflags_test (unsigned int a, unsigned int b)
  {
 -  unsigned x = (a == b);
 +  volatile char x = (a == b);
return __readeflags ();
  }
  
 --cut here--

It looks fine.  Thanks.

[Bug c++/65945] C++ alignment of nullptr_t is 1 and might cause unaligned stores to the frame

2015-07-10 Thread npl at chello dot at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65945

--- Comment #17 from npl at chello dot at ---
Hi,

so if I understand it right, the access fault itself isnt fixed, but if I use
ABI Version = 9 it wont occur with this code?

Should I open a separate Bug for the unaligned access issue?


[Bug tree-optimization/66828] [5/6 Regression] gcc/tree-ssa-math-opts.c:2182:38: runtime error: left shift of 72057594037927936 by 8 places cannot be represented in type 'long int'

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66828

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.2


[Bug middle-end/66313] Unsafe factorization of a*b+a*c

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #7 from Richard Biener rguenth at gcc dot gnu.org ---
gcc.dg/tree-ssa/pr23294.c should be still optimized, no?  there is not a single
case with a possibly overflowing addition in there.


[Bug middle-end/66313] Unsafe factorization of a*b+a*c

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #9 from Marek Polacek mpolacek at gcc dot gnu.org ---
With the conversion to unsigned we're also no longer able to optimize
tree-ssa/tailrecursion-6.c.


[Bug target/66563] [4.9/5 Regression] ICE (segmentation fault) on sh4-linux-gnu

2015-07-10 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66563

--- Comment #54 from John Paul Adrian Glaubitz glaubitz at physik dot 
fu-berlin.de ---
(In reply to Kazumoto Kojima from comment #53)
 (In reply to Kazumoto Kojima from comment #52)
 We are lucky:-)  The test for backport of PR66780 patch for gcc-5 was done
 and we get a chance to commit it:
 https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00819.html
 All known patches are applied to 5-branch and 5.2-release.

Woohoo, thanks a fortune!


[Bug middle-end/66313] Unsafe factorization of a*b+a*c

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #8 from Marek Polacek mpolacek at gcc dot gnu.org ---
Right now .optimized looks like this:

f6 (int a, int b)
{
  int _2; 
  int _4; 
  int _5; 

  bb 2: 
  _2 = a_1(D) * 3;
  _4 = _2 - b_3(D);
  _5 = _4 * 2;
  return _5; 

}

whereas if we compute the expression in unsigned, we generate this:

f6 (int a, int b)
{
  int _2; 
  unsigned int _3; 
  unsigned int b.5_5;
  unsigned int _6; 
  unsigned int _7; 
  int _8; 

  bb 2: 
  _2 = a_1(D) * -3; 
  _3 = (unsigned int) _2; 
  b.5_5 = (unsigned int) b_4(D);
  _6 = _3 + b.5_5;
  _7 = _6 * 4294967294;
  _8 = (int) _7; 
  return _8; 

}

But I see no other way ;(.


[Bug middle-end/66313] Unsafe factorization of a*b+a*c

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #5 from Marek Polacek mpolacek at gcc dot gnu.org ---
I think I'll restrict the computation in unsigned only for
TYPE_OVERFLOW_SANITIZED, otherwise we fail to optimize important stuff :/ (e.g.
tree-ssa/pr23294.c).


[Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910

2015-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Jul 10 10:26:19 2015
New Revision: 225661

URL: https://gcc.gnu.org/viewcvs?rev=225661root=gccview=rev
Log:
PR middle-end/66820
* gimplify.c (maybe_fold_stmt): Don't fold in ORT_PARALLEL
or ORT_TASK contexts.
* omp-low.c (lower_omp): Call fold_stmt even if taskreg_nesting_level
is non-zero.

* gcc.dg/gomp/pr66820.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/gomp/pr66820.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/omp-low.c
trunk/gcc/testsuite/ChangeLog


[Bug libstdc++/66829] New: [6 Regression] FAIL: 23_containers/multiset/modifiers/erase/dr130-linkage-check.cc

2015-07-10 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66829

Bug ID: 66829
   Summary: [6 Regression] FAIL:
23_containers/multiset/modifiers/erase/dr130-linkage-c
heck.cc
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
CC: jason at redhat dot com
  Target Milestone: ---

r225272 caused:

spawn -ignore SIGHUP /export/build/gnu/gcc-32bit/build-i686-linux/./gcc/xg++
-shared-libgcc -B/export/build/gnu/gcc-32bit/build-i686-linux/./gcc -nostdinc++
-L/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/src
-L/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/src/.libs
-L/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/libsupc++/.libs
-B/usr/gcc-6.0.0/i686-linux/bin/ -B/usr/gcc-6.0.0/i686-linux/lib/ -isystem
/usr/gcc-6.0.0/i686-linux/include -isystem
/usr/gcc-6.0.0/i686-linux/sys-include
-B/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/./libstdc++-v3/src/.libs
-D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2
-D_GNU_SOURCE -DLOCALEDIR=. -nostdinc++
-I/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/include/i686-linux
-I/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/include
-I/export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++
-I/export/gnu/import/git/sources/gcc/libstdc++-v3/include/backward
-I/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc
-fno-inline -std=gnu++11 ./testsuite_shared.so ./libtestc++.a -Wl,--gc-sections
-L/export/build/gnu/gcc-32bit/build-i686-linux/i686-linux/libstdc++-v3/src/filesystem/.libs
-lm -o ./dr130-linkage-check.exe
/tmp/ccJO7g8A.o: In function `void
__gnu_test::linkage_check_cxx98_cxx11_erasestd::multisetint, std::lessint,
std::allocatorint  (std::multisetint, std::lessint, std::allocatorint
)':
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util/testsuite_containers.h:261:
undefined reference to `__gnu_test::erase_external(std::multisetint,
std::lessint, std::allocatorint )'
/tmp/ccJO7g8A.o: In function `void
__gnu_test::linkage_check_cxx98_cxx11_erase_iteratorsstd::multisetint,
std::lessint, std::allocatorint  (std::multisetint, std::lessint,
std::allocatorint )':
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util/testsuite_containers.h:272:
undefined reference to `__gnu_test::erase_external_iterators(std::multisetint,
std::lessint, std::allocatorint )'
collect2: error: ld returned 1 exit status
compiler exited with status 1
output is:
/tmp/ccJO7g8A.o: In function `void
__gnu_test::linkage_check_cxx98_cxx11_erasestd::multisetint, std::lessint,
std::allocatorint  (std::multisetint, std::lessint, std::allocatorint
)':
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util/testsuite_containers.h:261:
undefined reference to `__gnu_test::erase_external(std::multisetint,
std::lessint, std::allocatorint )'
/tmp/ccJO7g8A.o: In function `void
__gnu_test::linkage_check_cxx98_cxx11_erase_iteratorsstd::multisetint,
std::lessint, std::allocatorint  (std::multisetint, std::lessint,
std::allocatorint )':
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util/testsuite_containers.h:272:
undefined reference to `__gnu_test::erase_external_iterators(std::multisetint,
std::lessint, std::allocatorint )'
collect2: error: ld returned 1 exit status

FAIL: 23_containers/multiset/modifiers/erase/dr130-linkage-check.cc (test for
excess errors)

Should this test be updated since we default to C++14 now?


[Bug target/66813] gcc.target/i386/asm-flag-5.c failed with -march=pentium

2015-07-10 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66813

--- Comment #2 from uros at gcc dot gnu.org ---
Author: uros
Date: Fri Jul 10 11:56:48 2015
New Revision: 225662

URL: https://gcc.gnu.org/viewcvs?rev=225662root=gccview=rev
Log:
PR target/66813
* config/i386/i386.c (ix86_md_asm_adjust): Emit movstrictqi
sequence for TARGET_ZERO_EXTEND_WITH_AND targets.

testsuite/ChangeLog:

PR target/66813
* gcc.target/i386/pr66813.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr66813.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog


[Bug c/66826] Unused result from dlsym in constructor results in a segfault

2015-07-10 Thread quae at daurnimator dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826

--- Comment #1 from Daurnimator quae at daurnimator dot com ---
nalaginrut (from #gcc irc channel) confirmed that the issue only occurs in GCC
5 at -O2 and higher. (the bug is *not* present in GCC 4.9 or at -O1).

Note: only the compilation of shared.so matters (the main binary can be
compiled with any setting or compiler and the same behaviour is shown.)


[Bug libstdc++/66829] [6 Regression] FAIL: 23_containers/multiset/modifiers/erase/dr130-linkage-check.cc

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66829

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-07-10
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
Confirmed.


[Bug other/66827] [6 Regression] left shifts of negative value warnings due to C++14 switch

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66827

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |6.0


[Bug target/66813] gcc.target/i386/asm-flag-5.c failed with -march=pentium

2015-07-10 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66813

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Target||x86
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Uroš Bizjak ubizjak at gmail dot com ---
Fixed.

[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #11 from Jason Merrill jason at gcc dot gnu.org ---
(In reply to Eric Niebler from comment #9)
 Created attachment 35950 [details]
 Bug number 4
 
 ICE ICE baby

Fixed.


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #9 from Eric Niebler eric.niebler at gmail dot com ---
Created attachment 35950
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35950action=edit
Bug number 4

ICE ICE baby


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #12 from Jason Merrill jason at gcc dot gnu.org ---
(In reply to Jason Merrill from comment #11)
 Fixed.

in r225710.


[Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters

2015-07-10 Thread michal.ruza at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66838

Bug ID: 66838
   Summary: Calling multiple SYSV AMD64 ABI functions from MS x64
ABI one results in clobbered parameters
   Product: gcc
   Version: 5.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: michal.ruza at gmail dot com
  Target Milestone: ---

Created attachment 35951
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35951action=edit
source code demonstrating the problem

This seems to be yet another corner case of bug 57003.

Description:
Calling a sequence of SYSV AMD64 ABI functions from an __attribute__((ms_abi))
function while passing an address of the same global variable to them results
in all but the first one in the sequence receiving clobbered values instead of
the expected address.

In code:
__attribute__((ms_abi, noinline, noclone)) void ms_abi_func() {
sysv_abi_func(1st call, global);
sysv_abi_func(2nd call, global);
sysv_abi_func(3rd call, global);
}
In this example only the first call of the sysv_abi_func is passed the
address of the global variable global. All the other calls of the function
are passed clobbered values.

To see the problem:
- generate assembly for the attached clobber_repro.c for the x86_64
architecture as follows:
gcc -S -O1 -m64 -o clobber_repro.S clobber_repro.c
- inspect the assembly code for the ms_abi_func fucntion
- you should see something like this after the function's prologue code:
movl$global, %esi
movl$.LC2, %edi
callsysv_abi_func
movl$.LC3, %edi
callsysv_abi_func
movl$.LC4, %edi
callsysv_abi_func

This apparently cannot work if sysv_abi_func clobbers %esi - and it is free
to do so as it is a SYSV AMD64 ABI function.

Additional notes:
- this doesn't happen when the ms_abi_func is NOT declared as
__attribute__((ms_abi))
- this doesn't happen when the sysv_abi_func IS declared as
__attribute__((ms_abi))
- this doesn't happen when the global is not a global variable - i.e. it
works when all of the calls are passed an address of the same local variable
- this doesn't happen when optimization is disabled (-O0)


[Bug c++/66834] [concepts] concept parameter kind mismatch causes hard error

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66834

--- Comment #1 from Jason Merrill jason at gcc dot gnu.org ---
This was introduced by my patch for bug 66092, applying the tentative
resolution of core issue 1430 to concepts as well as alias templates.  This
makes sense to me since they have the same issue of needing to substitute
dependent arguments into the template, in this case during normalization.

So I think your example is invalid, but it could use some discussion in core.


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

Eric Niebler eric.niebler at gmail dot com changed:

   What|Removed |Added

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

--- Comment #10 from Eric Niebler eric.niebler at gmail dot com ---
Lest I seem ungrateful, thank you for your work so far. I'm still ICE-ing the
compiler, though. See the fourth attachment.


Small typo in gcc/params.def

2015-07-10 Thread Philipp Thomas
Noticed while doing translation of the gcc messages. Please apply to trunk
if OK as I have no rfead/write access anymore AFAIK.

2015-07-10  Philipp Thomas p...@suse.de

   * params.def: fix typo.

index 3e4ba3a..08b5c7f 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -572,7 +572,7 @@ DEFPARAM(PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS,
 
 DEFPARAM(PARAM_VECT_MAX_PEELING_FOR_ALIGNMENT,
  vect-max-peeling-for-alignment,
- Max number of loop peels to enhancement alignment of data references 
in a loop,
+ Max number of loop peels to enhance alignment of data references in 
a loop,
  -1, -1, 64)
 
 DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,


[Bug middle-end/66633] [5/6 regression] ICE on valid verify_gimple failed with OpenMP

2015-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66633

--- Comment #17 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Jul 10 14:13:19 2015
New Revision: 225677

URL: https://gcc.gnu.org/viewcvs?rev=225677root=gccview=rev
Log:
Backported from mainline
2015-07-09  Jakub Jelinek  ja...@redhat.com

PR middle-end/66633
* tree-nested.c (get_static_chain): Or in a flag into
info-static_chain_added.
(get_frame_field, get_nonlocal_debug_decl): Likewise.
(convert_nonlocal_omp_clauses, convert_local_omp_clauses): Revert
2015-07-01 changes.
(convert_tramp_reference_stmt): If a frame_decl or chain_decl
is needed newly inside of GIMPLE_OMP_{PARALLEL,TASK,TARGET} body,
add it to clauses.

* gcc.dg/gomp/pr66633-1.c: New test.
* gcc.dg/gomp/pr66633-2.c: New test.
* gcc.dg/gomp/pr66633-3.c: New test.
* gcc.dg/gomp/pr66633-4.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66633-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66633-2.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66633-3.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66633-4.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-nested.c


[Bug middle-end/66633] [5/6 regression] ICE on valid verify_gimple failed with OpenMP

2015-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66633

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #18 from Jakub Jelinek jakub at gcc dot gnu.org ---
Fixed.


Re: Small typo in gcc/params.def

2015-07-10 Thread Markus Trippelsdorf
On 2015.07.10 at 16:58 +0200, Philipp Thomas wrote:
 Noticed while doing translation of the gcc messages. Please apply to trunk
 if OK as I have no rfead/write access anymore AFAIK.

Patches should be sent to gcc-patc...@gcc.gnu.org.
gcc-bugs@gcc.gnu.org is for automated Bugzilla mail only.

-- 
Markus


[Bug libgomp/66715] libgomp.oacc-c/../libgomp.oacc-c-c++-common/data-{2,3}.c exec fails -Ofast

2015-07-10 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66715

vries at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #2 from vries at gcc dot gnu.org ---
-Ofast: Optimize for speed disregarding exact standards compliance

The testcase contains floating point operations. So, marking resolved-invalid.


[Bug middle-end/66313] Unsafe factorization of a*b+a*c

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66313

--- Comment #6 from Marek Polacek mpolacek at gcc dot gnu.org ---
No, that's not a good approach either.


[Bug tree-optimization/66823] -ftree-loop-if-convert-stores miscompiles gfortran.dg/elemental_optional_args_3.f90

2015-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66823

--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Fri Jul 10 12:33:28 2015
New Revision: 225671

URL: https://gcc.gnu.org/viewcvs?rev=225671root=gccview=rev
Log:
2015-07-10  Richard Biener  rguent...@suse.de

Backport from mainline
2015-07-10  Richard Biener  rguent...@suse.de

PR tree-optimization/66823
* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
inverted predicate.

* gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores
which should not be necessary.  XFAIL.

2015-07-08  Richard Biener  rguent...@suse.de

PR middle-end/43341
* toplev.c (compile_file): Reset maximum_field_alignment after parsing.

2015-07-08  Richard Biener  rguent...@suse.de

PR tree-optimization/66794
* gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
Free post-dominators.

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

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66794.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/gcc.dg/vect/pr61194.c
branches/gcc-5-branch/gcc/toplev.c
branches/gcc-5-branch/gcc/tree-if-conv.c


[Bug c++/66830] New: Problem with C++ unique symbols in plugins

2015-07-10 Thread pleuba at swissonline dot ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66830

Bug ID: 66830
   Summary: Problem with C++ unique symbols in plugins
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pleuba at swissonline dot ch
  Target Milestone: ---

I have a problem in an application loading several plugins using the same
library containing a static variable (object of class, not POD) in an inline
function.

The compiler generates STB_GNU_UNIQUE symbols for the the variable and its
guard.

Scenario:
- dlopen plugin1 (dynamic loader detect the unique variables and mark DSO as
not unloadable)
- dlopen plugin2 (dynamic loader will uses the unique variables of plugin1 and
do NOT mark DSO as unloadable, because its unique symbol is not used)
- Invoke some code in plugin2 that call the inline function, so the variable
(of plugin 1) is constructed and its guard marked initialized, but the
destructor of the variable is incorrectly registered with __cxa_atexit to be
called on unload of plugin2.
- dlclose the plugin2, so it is unloaded, __CXA_finalize calls the destructor
of the global variable owned by plugin1 !, keeping the guard marked as
initialised.
- If we reload the plugin2, it will not reconstruct the global variable as it
is still marked as initialised and access it. This results either immediately
or later in crash.

Using compiler flag -fno-gnu-unique prevents the problem.

Is this problem already known ?

Philippe


[Bug rtl-optimization/66782] [5/6 Regression] Unable to run 64-bit wine after MS-SYSV register changes

2015-07-10 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66782

--- Comment #14 from Vladimir Makarov vmakarov at gcc dot gnu.org ---
Author: vmakarov
Date: Fri Jul 10 13:17:02 2015
New Revision: 225674

URL: https://gcc.gnu.org/viewcvs?rev=225674root=gccview=rev
Log:
2015-07-10  Vladimir Makarov  vmaka...@redhat.com

Backport from mainline
2015-07-09  Vladimir Makarov  vmaka...@redhat.com

PR rtl-optimization/66782
* lra-int.h (struct lra_insn_recog_data): Add comment about
clobbered hard regs for arg_hard_regs.
* lra.c (lra_set_insn_recog_data): Add clobbered hard regs.
* lra-lives.c (process_bb_lives): Process clobbered hard regs.
Add condition for processing used hard regs.
* lra-constraints.c (update_ebb_live_info, inherit_in_ebb):
Process clobbered hard regs.


Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/lra-constraints.c
branches/gcc-5-branch/gcc/lra-int.h
branches/gcc-5-branch/gcc/lra-lives.c
branches/gcc-5-branch/gcc/lra.c


[Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910

2015-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Jul 10 14:14:18 2015
New Revision: 225678

URL: https://gcc.gnu.org/viewcvs?rev=225678root=gccview=rev
Log:
PR middle-end/66820
* gimplify.c (maybe_fold_stmt): Don't fold in ORT_PARALLEL
or ORT_TASK contexts.
* omp-low.c (lower_omp): Call fold_stmt even if taskreg_nesting_level
is non-zero.

* gcc.dg/gomp/pr66820.c: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/gomp/pr66820.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/omp-low.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog


[Bug middle-end/66820] [5/6 Regression] internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910

2015-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66820

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #10 from Jakub Jelinek jakub at gcc dot gnu.org ---
Fixed.


[Bug c++/60842] In-class initializer causes a strange error

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60842

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com ---
Done.


[Bug c++/60842] In-class initializer causes a strange error

2015-07-10 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60842

--- Comment #5 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org ---
Author: paolo
Date: Fri Jul 10 14:44:43 2015
New Revision: 225679

URL: https://gcc.gnu.org/viewcvs?rev=225679root=gccview=rev
Log:
2015-07-10  Paolo Carlini  paolo.carl...@oracle.com

PR c++/60842
* g++.dg/cpp0x/nsdmi-template15.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template15.C
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug c/52749] Aliasing violation silently accepted

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52749

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||mpolacek at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org ---
-O2 -Wstrict-aliasing=1 gives the warning, so I think fixed.


[Bug tree-optimization/66372] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66372

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org ---
Started with r223448.


[Bug c++/62085] SFINAE where specialization parameter class member returns an abstract type fails

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62085

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

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

--- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com ---
Not a bug. See: https://gcc.gnu.org/ml/gcc/2015-07/msg00148.html


[Bug c++/21385] __extension__ lost inside template

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21385

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org

--- Comment #7 from Paolo Carlini paolo.carlini at oracle dot com ---
Not seriously, for the time being. Unassigning.


[Bug rtl-optimization/66782] [5/6 Regression] Unable to run 64-bit wine after MS-SYSV register changes

2015-07-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66782

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #15 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
fixed


[Bug c++/61991] Destructors not always called for statically initialized thread_local objects

2015-07-10 Thread scovich at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61991

--- Comment #1 from Ryan Johnson scovich at gmail dot com ---
C++14 (N3652 [1]) specifically alters the Standard to state that a thread_local
object with static or constexpr initialization may have a non-trivial
destructor (implying that such a destructor should actually run):

 Variables with static storage duration (3.7.1) or thread storage duration
 (3.7.2) shall be zero-initialized (8.5) before any other initialization takes
 place. A constant initializer for an object o is an expression that is a
 constant expression, except that it may also invoke constexpr constructors for
 o and its subobjects even if those objects are of non-literal class types
 [ Note: such a class may have a non-trivial destructor ].

[1] https://isocpp.org/files/papers/N3652.html


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #3 from Jason Merrill jason at gcc dot gnu.org ---
Fixed.


[Bug c++/66218] [c++-concepts] inconsistent deduction for ‘auto’ with a partial-concept-id in a deduction constraint

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66218

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||andrew.n.sutton at gmail dot 
com,
   ||jason at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #2 from Jason Merrill jason at gcc dot gnu.org ---
Fixed.


[Bug c++/60842] In-class initializer causes a strange error

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60842

--- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com ---
This is fixed in mainline. I'm adding the testcase and closing the bug.


[Bug c++/13590] [DR39] Non-existing ambiguity when inheriting through virtuals two identical using declarations.

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13590

--- Comment #22 from Paolo Carlini paolo.carlini at oracle dot com ---
Not sure if Fabien is actively working on this..


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

Eric Niebler eric.niebler at gmail dot com changed:

   What|Removed |Added

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

--- Comment #5 from Eric Niebler eric.niebler at gmail dot com ---
The previous fix caused the code in the third attachment to stop working.


[Bug c++/54521] g++ fails to call explicit constructors in the second step of copy initialization

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54521

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com ---
Mine.


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #4 from Eric Niebler eric.niebler at gmail dot com ---
Created attachment 35948
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35948action=edit
Preprocessed source, bug the third

The previous fix caused the code in attachment #3 to stop working.


[Bug fortran/66833] New: [4.9/5.1/6.0]: ICE on assumed-rank character actual argument to intrinsic functions

2015-07-10 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66833

Bug ID: 66833
   Summary: [4.9/5.1/6.0]: ICE on assumed-rank character actual
argument to intrinsic functions
   Product: gcc
   Version: 4.9.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

Invoking a rank, lbound, ubound, or c_loc with an assumed-rank character array
actual argument causes an ICE with gfortran 4.9.3, 5.1.0, or 6.0.0.  I wonder
if this is related to Bug 5733. 

$ cat opencoarrays.f90 
subroutine gfc_descriptor_c_char(a) 
  character a(..)
  print *,rank(a) ! ICE (also for lbound, ubound, and c_loc)
end subroutine

$ gfortran -c opencoarrays.f90 
opencoarrays.f90: In function 'gfc_descriptor_c_char':
opencoarrays.f90:3:0: internal compiler error: in gfc_conv_descriptor_dtype, at
fortran/trans-array.c:239
   print *,rank(a) ! ICE (also for lbound, ubound, and c_loc)
 ^

opencoarrays.f90:3:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort trap: 6

$ gfortran --version
GNU Fortran (MacPorts gcc49 4.9.3_0) 4.9.3


[Bug c++/66832] New: [concepts] parameters in requires clauses conflicting with function arguments

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66832

Bug ID: 66832
   Summary: [concepts] parameters in requires clauses conflicting
with function arguments
   Product: gcc
   Version: c++-concepts
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eric.niebler at gmail dot com
  Target Milestone: ---

template class T, class U, unsigned N
  requires requires (T t, U u) { t.foo(); u.foo(); }
void foo_all( T (t)[N], U (u)[N] ) {
  for(auto x : t)
  x.foo();
  for(auto x : u)
  x.foo();
}

struct S {
  void foo() {}
};

int main() {
  S rg[4] {};
  foo_all(rg, rg);
}


Yields:

/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:23: error: conflicting
declaration ‘T ( t)[N]’
 void foo_all( T (t)[N], U (u)[N] ) {
   ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:3:25: note: previous
declaration as ‘T t’
   requires requires (T t, U u) { t.foo(); u.foo(); }
 ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp: In function ‘void
foo_all(U ()[N])’:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:5:18: error: use of
parameter outside function body before ‘)’ token
   for(auto x : t)
  ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp: In function ‘int
main()’:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:17:17: error: no matching
function for call to ‘foo_all(S [4], S [4])’
   foo_all(rg, rg);
 ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:6: note: candidate:
templateclass T, class U, unsigned int N  requires predicate(r
equires(T t, U u) {t-foo();u-foo();}) void foo_all(U ()[N])
 void foo_all( T (t)[N], U (u)[N] ) {
  ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:4:6: note:   template
argument deduction/substitution failed:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:17:17: note:   candidate
expects 1 argument, 2 provided
   foo_all(rg, rg);
 ^

[Bug c++/66834] New: [concepts] concept parameter kind mismatch causes hard error

2015-07-10 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66834

Bug ID: 66834
   Summary: [concepts] concept parameter kind mismatch causes hard
error
   Product: gcc
   Version: c++-concepts
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eric.niebler at gmail dot com
  Target Milestone: ---

Before rev 225651 (the fix for #66758), the following worked. It no longer
does. Not sure if it's legit.

template class From, class To
concept bool ExplicitlyConvertible =
  requires (From f) {
static_castTo((From)f);
  };

template class T, class... Args
concept bool Constructible =
  ExplicitlyConvertibleArgs..., T ||
  requires (Args... args) {
T{((Args)(args))...};
  };

template class T, class...Args
constexpr bool constructible() { return false; }

Constructible{T, ...Args}
constexpr bool constructible() { return false; }

int main() {}


Yields:

/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp: In function ‘constexpr
bool Constructible()’:
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:9:5: error: pack
expansion argument for non-pack parameter ‘From’ of concept ‘template
class From, class To constexpr const bool ExplicitlyConvertibleFrom, To’
 ExplicitlyConvertibleArgs..., T ||
 ^
/cygdrive/c/Users/eric/Code/cmcstl2/test/iterator.cpp:1:11: note: declared here
 template class From, class To 
   ^

[Bug lto/66752] spec2000 255.vortex performance compiled with GCC is ~20% lower than with CLANG

2015-07-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66752

--- Comment #5 from Andrew Pinski pinskia at gcc dot gnu.org ---
Looks like bug 13876.


[Bug middle-end/66353] Missing bb_has_abnormal_call_pred in basic-block.h

2015-07-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66353

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-07-10
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Makes sense.


[Bug lto/66752] spec2000 255.vortex performance compiled with GCC is ~20% lower than with CLANG

2015-07-10 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66752

Yuri Rumyantsev ysrumyan at gmail dot com changed:

   What|Removed |Added

 CC||ysrumyan at gmail dot com

--- Comment #3 from Yuri Rumyantsev ysrumyan at gmail dot com ---
We found out simple reproducer for this issue which is attached.
The problem is redundant test in loop:

  for (i = -1, flag = 1; ++i  N  flag;)
if (a[i] == b)  set 'flag' to 0  do something

It is clear that test 'flag==1' can be deleted since there is the only place
where it is set up to zero (then-part).
Note that clang deletes it.


[Bug lto/66752] spec2000 255.vortex performance compiled with GCC is ~20% lower than with CLANG

2015-07-10 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66752

--- Comment #4 from Yuri Rumyantsev ysrumyan at gmail dot com ---
Created attachment 35947
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35947action=edit
test-case to reproduce

compile with -Ofast -m32 -march=slm and notice redundant test
.L30:
testl   %edx, %edx
je  .L1


[Bug testsuite/66831] New: FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align

2015-07-10 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66831

Bug ID: 66831
   Summary: FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler
p2align
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
CC: ubizjak at gmail dot com
  Target Milestone: ---

When GCC is configured with --with-cpu=nocona, we got

FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align

It is due to

{nocona, nocona_cost, 0, 0, 0, 0, 0},

in i386.c.


[Bug lto/66835] New: C++ openMP test failed after switching to C++14

2015-07-10 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66835

Bug ID: 66835
   Summary: C++ openMP test failed after switching to C++14
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: evstupac at gmail dot com
  Target Milestone: ---

The following test:
#define max(a, b)   ( (a)  (b) ? (a) : (b) ) 

float a[4] = {0, -1.2, 7, 0.1}; 

int main() 
{ 
#pragma omp simd 
  for (int j = 0; j  4; j++) 
{ 
  float t1 = 0.1; 
  a[j] = max(t1, a[j]); 
} 
  return (int)(a[1] - a[3]); 
} 

fails with ICE after recent switch to std=c++14

Compiled with -O2 -flto -fopenmp -std=c++14

The test began to fail after:
commit 23a92fc764dc04a0248a570bba74db0a7f7d843d
Author: tbsaunde tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4
Date:   Tue Nov 11 02:31:00 2014 +


[Bug lto/66835] C++ openMP test failed after switching to C++14

2015-07-10 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66835

--- Comment #1 from Stupachenko Evgeny evstupac at gmail dot com ---
wrong revision bisected. Was just bootstrap fail. Searching for really bad.


[Bug rtl-optimization/66087] Invalid narrowing of MEM with containing POST_INC

2015-07-10 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66087

--- Comment #2 from Andreas Schwab sch...@linux-m68k.org ---
I think combine should reject this.


[Bug target/66703] [4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586 or on -miamcu

2015-07-10 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66703

--- Comment #6 from uros at gcc dot gnu.org ---
Author: uros
Date: Fri Jul 10 15:32:48 2015
New Revision: 225680

URL: https://gcc.gnu.org/viewcvs?rev=225680root=gccview=rev
Log:
PR target/66703
* gcc.target/i386/readeflags-1.c (readeflags_test): Declare with
__attribute__((noinline, noclone)).  Change x to volatile char
type to prevent possible flag-clobbering zero-extensions.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/i386/readeflags-1.c


[Bug ada/66837] New: Non-Native Default_Scalar_Storage_Order Breaks Enum'Image

2015-07-10 Thread MatthewS.Grochowalski at ge dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66837

Bug ID: 66837
   Summary: Non-Native Default_Scalar_Storage_Order Breaks
Enum'Image
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
  Assignee: unassigned at gcc dot gnu.org
  Reporter: MatthewS.Grochowalski at ge dot com
  Target Milestone: ---

Created attachment 35949
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35949action=edit
Test Case

Encountered with build of r225405 of the scalar-storage-order branch.

Attached test case dies with a STORAGE_ERROR when calling 'Image() on
enumeration values.

The values in the index array generated by
Exp_Imgv.Build_Enumeration_Image_Tables are being byte-swapped due to the
Default_Scalar_Storage_Order pragma.

System.Img_Enum_New.Image_Enumeration_16 (in this case) treats the index array
as native scalar storage order, causing things to blow up.


[Bug lto/66835] C++ openMP test failed after switching to C++14

2015-07-10 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66835

--- Comment #3 from Stupachenko Evgeny evstupac at gmail dot com ---
The same reproduced on GCC 5.


[Bug lto/66835] C++ openMP test failed after switching to C++14

2015-07-10 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66835

Stupachenko Evgeny evstupac at gmail dot com changed:

   What|Removed |Added

 CC||izamyatin at gmail dot com,
   ||jakub at redhat dot com

--- Comment #2 from Stupachenko Evgeny evstupac at gmail dot com ---
The following commit made the test compiled with -O2 -flto -fopenmp
-std=c++14 fail with ICE:

commit 0c368492c85091d7b90cade269c45aba4cee77f5
Author: jakub jakub@138bc75d-0d04-0410-961f-82ee72b054a4
Date:   Fri Nov 14 19:41:00 2014 +

* tree-ssa.dce.c (eliminate_unnecessary_stmts): Eliminate
IFN_GOMP_SIMD_LANE without lhs as useless.


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


ICE details:

lto1: internal compiler error: in operator[], at vec.h:736
0xc0a220 vectree_node*, va_heap, vl_embed::operator[](unsigned int)
/export/users/evstupac/gcc/git/check2/gcc/gcc/vec.h:736
0xc0a220 vectree_node*, va_heap, vl_ptr::operator[](unsigned int)
/export/users/evstupac/gcc/git/check2/gcc/gcc/vec.h:1202
0xc0a220 streamer_tree_cache_get_tree
/export/users/evstupac/gcc/git/check2/gcc/gcc/tree-streamer.h:112
0xc0a220 streamer_get_pickled_tree(lto_input_block*, data_in*)
/export/users/evstupac/gcc/git/check2/gcc/gcc/tree-streamer-in.c:1102
0x903af4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1296
0x903dba lto_input_tree(lto_input_block*, data_in*)
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1342
0xc091df lto_input_ts_decl_minimal_tree_pointers
/export/users/evstupac/gcc/git/check2/gcc/gcc/tree-streamer-in.c:697
0xc091df streamer_read_tree_body(lto_input_block*, data_in*, tree_node*)
/export/users/evstupac/gcc/git/check2/gcc/gcc/tree-streamer-in.c:1043
0x9034ff lto_read_tree_1
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1172
0x9039e4 lto_read_tree
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1206
0x9039e4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1325
0x903d20 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned
int*)
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1230
0x903d94 lto_input_tree(lto_input_block*, data_in*)
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1340
0x905528 input_cfg
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:739
0x905528 input_function
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:950
0x905528 lto_read_body_or_constructor
/export/users/evstupac/gcc/git/check2/gcc/gcc/lto-streamer-in.c:1101
0x6303f9 cgraph_node::get_body()
/export/users/evstupac/gcc/git/check2/gcc/gcc/cgraph.c:3170


[Bug target/66819] gcc.target/i386/pr65753.c fails with -fPIC -m32 -O2 -mregparm=3

2015-07-10 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66819

--- Comment #1 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org ---
Author: hjl
Date: Fri Jul 10 20:30:10 2015
New Revision: 225688

URL: https://gcc.gnu.org/viewcvs?rev=225688root=gccview=rev
Log:
Allow indirect sibcall with register arguments

Indirect sibcall with register arguments is OK when there is register
available for argument passing.

gcc/

PR target/66819
* config/i386/i386.c (ix86_function_ok_for_sibcall): Allow
indirect sibcall with register arguments if register available
for argument passing.
(init_cumulative_args): Set cfun-machine-arg_reg_available
to (cum-nregs  0) or to true if function has a variable
argument list.
(function_arg_advance_32): Set cfun-machine-arg_reg_available
to false if cum-nregs = 0.
* config/i386/i386.h (machine_function): Add arg_reg_available.

gcc/testsuite/

PR target/66819
* gcc.target/i386/pr66819-1.c: New test.
* gcc.target/i386/pr66819-2.c: Likewise.
* gcc.target/i386/pr66819-3.c: Likewise.
* gcc.target/i386/pr66819-4.c: Likewise.
* gcc.target/i386/pr66819-5.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr66819-1.c
trunk/gcc/testsuite/gcc.target/i386/pr66819-2.c
trunk/gcc/testsuite/gcc.target/i386/pr66819-3.c
trunk/gcc/testsuite/gcc.target/i386/pr66819-4.c
trunk/gcc/testsuite/gcc.target/i386/pr66819-5.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/i386.h
trunk/gcc/testsuite/ChangeLog


[Bug c++/66836] New: inconsistent unqualified lookup for friend declaration

2015-07-10 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66836

Bug ID: 66836
   Summary: inconsistent unqualified lookup for friend declaration
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Consider the following code, courtesy of Belloc
(http://stackoverflow.com/q/31348475/2069064):

struct Outer {
void f() { }
class C { };

class Inner {
friend class C;
friend void f();
static const int i = 0;
};
};

void f() { int i = Outer::Inner::i; }
class C { int i = Outer::Inner::i; };

int main() { }

According to [namespace.memdef]/3, the lookup to determine whether the entity
has been previously declared shall not consider any scopes outside the
innermost enclosing namespace. 

There's some confusion as to what outside means in this context, but
regardless both GCC and Clang are inconsistent in their interpretation. Either
it means exclusively the innermost enclosing namespace (in which case both ::f
and ::C should be friends) or it just means stop at the innermost enclosing
namespace (in which case both Outer::f and Outer::C should be friends). But in
this case, both GCC and Clang friend ::f and Outer::C, which is a bug in one
direction or the other.


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #6 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 22:11:22 2015
New Revision: 225696

URL: https://gcc.gnu.org/viewcvs?rev=225696root=gccview=rev
Log:
PR c++/66758
* gcc/cp/pt.c (tsubst_constraint_variables): Clear
cp_unevaluated_operand.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req14.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/constraint.cc


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #7 from Jason Merrill jason at gcc dot gnu.org ---
(In reply to Eric Niebler from comment #4)
 The previous fix caused the code in attachment #3 [details] to stop working.

Fixed.


[Bug c++/66758] [concepts] ICE compiler deeply confused by simple-seeming concept definition

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66758

--- Comment #8 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 22:45:41 2015
New Revision: 225704

URL: https://gcc.gnu.org/viewcvs?rev=225704root=gccview=rev
Log:
PR c++/66758
PR c++/66832
* gcc/cp/parser.c (cp_parser_requires_expression): Call grokparms here.
(cp_parser_requirement_parameter_list): Not here.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req15.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/parser.c


[Bug c++/66832] [concepts] parameters in requires clauses conflicting with function arguments

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66832

--- Comment #1 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Jul 10 22:45:41 2015
New Revision: 225704

URL: https://gcc.gnu.org/viewcvs?rev=225704root=gccview=rev
Log:
PR c++/66758
PR c++/66832
* gcc/cp/parser.c (cp_parser_requires_expression): Call grokparms here.
(cp_parser_requirement_parameter_list): Not here.

Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req15.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/parser.c


[Bug c++/66832] [concepts] parameters in requires clauses conflicting with function arguments

2015-07-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66832

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #2 from Jason Merrill jason at gcc dot gnu.org ---
Fixed.


[Bug c++/54521] g++ fails to call explicit constructors in the second step of copy initialization

2015-07-10 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54521

--- Comment #7 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org ---
Author: paolo
Date: Fri Jul 10 22:56:35 2015
New Revision: 225705

URL: https://gcc.gnu.org/viewcvs?rev=225705root=gccview=rev
Log:
/cp
2015-07-10  Paolo Carlini  paolo.carl...@oracle.com

PR c++/54521
* call.c (convert_like_real): Do not set LOOKUP_ONLYCONVERTING for
the second step of copy-initialization.

/testsuite
2015-07-10  Paolo Carlini  paolo.carl...@oracle.com

PR c++/54521
* g++.dg/init/explicit3.C: New.

Added:
trunk/gcc/testsuite/g++.dg/init/explicit3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/54521] g++ fails to call explicit constructors in the second step of copy initialization

2015-07-10 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54521

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org
   Target Milestone|--- |6.0

--- Comment #8 from Paolo Carlini paolo.carlini at oracle dot com ---
Fixed for 6.0.


[Bug c++/30044] ICE in tsubst, at cp/pt.c:7359

2015-07-10 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30044

--- Comment #8 from Patrick Palka ppalka at gcc dot gnu.org ---
Author: ppalka
Date: Fri Jul 10 23:21:39 2015
New Revision: 225706

URL: https://gcc.gnu.org/viewcvs?rev=225706root=gccview=rev
Log:
Fix PR c++/30044

gcc/cp/ChangeLog:

PR c++/30044
* pt.c (begin_template_parm_list): Add a dummy parameter level
to current_template_parms.
(end_template_parm_list): Remove the dummy parameter level
before adding the real one.
(tsubst): Don't attempt to substitute for template parameters
corresponding to a dummy argument level.
(template_parms_to_args): Remove obsolete hack for
giving template template arguments the proper level.
(splite_late_return_type): Remove obsolete hack for giving
template template arguments the proper level.
* error.c (dump_template_decl): Don't print dummy template
levels.

gcc/testsuite/ChangeLog

PR c++/30044
* g++.dg/cpp0x/auto46.C: New test.
* g++.dg/template/pr30044.C: New test.
* g++.dg/template/shadow2.C: New test.
* g++.dg/template/error55.C: New test.
* g++.dg/template/crash83.C: Accept any error string.
* g++.dg/cpp0x/variadic18.C: Adjust to avoid shadowing template
parameters.
* g++.dg/cpp0x/variadic18.C: Likewise
* g++.dg/template/canon-type-13.C: Likewise.
* g++.old-deja/g++.pt/ttp42.C: Likewise.
* g++.dg/torture/20070621-1.C: Likewise.


Added:
trunk/gcc/testsuite/g++.dg/cpp0x/auto46.C
trunk/gcc/testsuite/g++.dg/template/error55.C
trunk/gcc/testsuite/g++.dg/template/pr30044.C
trunk/gcc/testsuite/g++.dg/template/shadow2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/variadic18.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic19.C
trunk/gcc/testsuite/g++.dg/template/canon-type-13.C
trunk/gcc/testsuite/g++.dg/template/crash83.C
trunk/gcc/testsuite/g++.dg/torture/20070621-1.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/ttp42.C


[Bug tree-optimization/66740] [6 Regression] omp simd reduction miscompiles at -O3 with AVX (recent regression)

2015-07-10 Thread tprince at computer dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66740

--- Comment #4 from tprince at computer dot org ---
It optimizes with implicit simd reduction and gives correct result with option
-ffast-math in place of -fopenmp.