[Bug target/58945] Improve atomic_compare_and_swap*_doubleword pattern

2014-10-17 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58945

--- Comment #5 from Uroš Bizjak  ---
Created attachment 33744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33744&action=edit
Simplified patch

Somehow simplified patch for mainline. Still fails with -O2 -mcx16:

atomic-store-6.c: In function ‘main’:
atomic-store-6.c:13:1: error: unable to find a register to spill
 }
 ^
atomic-store-6.c:13:1: error: this is the insn:
(insn 9 48 47 3 (parallel [
(set (reg:TI 101 [86])
(unspec_volatile:TI [
(mem/v:TI (symbol_ref:DI ("i")  ) [-1  S16 A128])
(reg:TI 101 [86])
(reg:DI 102 [99])
(reg:DI 99)
(const_int 5 [0x5])
] UNSPECV_CMPXCHG))
(set (mem/v:TI (symbol_ref:DI ("i")  )
[-1  S16 A128])
(unspec_volatile:TI [
(const_int 0 [0])
] UNSPECV_CMPXCHG))
(set (reg:CCZ 17 flags)
(unspec_volatile:CCZ [
(const_int 0 [0])
] UNSPECV_CMPXCHG))
]) atomic-store-6.c:9 4876 {atomic_compare_and_swapti_doubleword}
 (expr_list:REG_DEAD (reg:DI 102 [99])
(nil)))
atomic-store-6.c:13:1: internal compiler error: in assign_by_spills, at
lra-assigns.c:1363

[Bug ipa/63566] [5 Regression] i686 bootstrap fails: ICE RTL flag check: INSN_UID used with unexpected rtx code 'set' in INSN_UID, at rtl.h:1326

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63566

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |5.0

--- Comment #5 from Jakub Jelinek  ---
Self-contained testcase (-m32 -O2 to reproduce):
#define A \
  x += y * z; \
  y = (y << ((z & 2) + 1)) \
  ^ (y >> (__SIZEOF_INT__ * __CHAR_BIT__ - (z & 2) - 1)); \
  z *= 7;
#define B A A A A A A A A A A
#define C B B B B B B B B B B

static unsigned int
f1 (unsigned int x, unsigned int y, unsigned int z)
{
  C
  return x + y + z;
}

static unsigned int
f2 (unsigned int x, unsigned int y, unsigned int z)
{
  C
  return x + y + z;
}

__attribute__((noinline, noclone)) unsigned int
f3 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (x, z, y) + 6;
}

__attribute__((noinline, noclone)) unsigned int
f4 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y, x, z) + 7;
}

__attribute__((noinline, noclone, used)) unsigned int
f5 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (2 * x, z / 2, y + 3) - 6;
}

__attribute__((noinline, noclone, used)) unsigned int
f6 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y + 2, x | 1, z / 73) + 1;
}

int
main ()
{
  unsigned int x = f3 (0x173214, 0x182172, 0x9314);
  unsigned int y = f4 (0x173214, 0x182172, 0x9314);
#if __SIZEOF_INT__ * __CHAR_BIT__ == 32
  if (x != 0xd8e56f78U || y != 0x494c6699U)
__builtin_abort ();
#endif
  return 0;
}

BTW, this testcase also shows that the debug info state of ICF is not really
solved:

grep '\.set' h.s; grep -A2 'DIE.*\(DW_TAG_subprogram\|DW_TAG_GNU_call_site)\)'
h.s
.setf1,f2
.uleb128 0x3# (DIE (0x2f) DW_TAG_subprogram)
.ascii "f2\0"# DW_AT_name
.byte0x1# DW_AT_decl_file (/tmp/h.c)
--
.uleb128 0x5# (DIE (0x6f) DW_TAG_subprogram)
# DW_AT_external
.ascii "f3\0"# DW_AT_name
--
.uleb128 0x7# (DIE (0xab) DW_TAG_GNU_call_site)
.long.LVL559# DW_AT_low_pc
.byte0# end of children of DIE 0x6f
.uleb128 0x5# (DIE (0xb1) DW_TAG_subprogram)
# DW_AT_external
.ascii "f4\0"# DW_AT_name
--
.uleb128 0x8# (DIE (0xed) DW_TAG_GNU_call_site)
.long.LVL561# DW_AT_low_pc
.long0x2f# DW_AT_abstract_origin
--
.uleb128 0x5# (DIE (0x10d) DW_TAG_subprogram)
# DW_AT_external
.ascii "f5\0"# DW_AT_name
--
.uleb128 0x7# (DIE (0x149) DW_TAG_GNU_call_site)
.long.LVL563# DW_AT_low_pc
.byte0# end of children of DIE 0x10d
.uleb128 0x5# (DIE (0x14f) DW_TAG_subprogram)
# DW_AT_external
.ascii "f6\0"# DW_AT_name
--
.uleb128 0x8# (DIE (0x18b) DW_TAG_GNU_call_site)
.long.LVL565# DW_AT_low_pc
.long0x2f# DW_AT_abstract_origin
--

shows that
1) there is no DW_TAG_subprogram for f1 emitted (what exactly should be the
content of it is up to the discussions with GDB folks I guess, either pretty
much a copy of DW_TAG_subprogram for f2 with adjusted real type if needed,
perhaps different names of arguments etc., or some way to refer to f2
subprogram DIE and telling it is ICF merged)
2) probably because of that DW_TAG_GNU_call_site in f3 and f5 don't have
DW_AT_abstract_origin, meaning that even if the debugger had right code to
handle ICF, it could not, because we are not telling it that we were calling f1
there


[Bug target/58945] Improve atomic_compare_and_swap*_doubleword pattern

2014-10-17 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58945

--- Comment #6 from Uroš Bizjak  ---
Hm, starting from:

(unspec_volatile:TI [
(mem/v:TI (symbol_ref:DI ("i")  ) [-1  S16 A128])
(reg:TI 85)
(reg:DI 97)
(reg:DI 98 [+8 ])
(const_int 5 [0x5])


fwprop creates:

(unspec_volatile:TI [
(mem/v:TI (symbol_ref:DI ("i")  ) [-1  S16 A128])
(reg:TI 86)
(reg:DI 97)
(reg:DI 97)
(const_int 5 [0x5])

Register allocators can't allocate reg 97 to "b" and "c" constraint:

(unspec_volatile:
  [(match_operand: 1 "memory_operand" "+m")
   (match_operand: 2 "register_operand" "0")
   (match_operand:DWIH 3 "register_operand" "b")
   (match_operand:DWIH 4 "register_operand" "c")
   (match_operand:SI 5 "const_int_operand")]
  UNSPECV_CMPXCHG))

So, a fwprop bug?

[Bug rtl-optimization/61605] Potential optimization: Keep unclobbered argument registers live across function calls

2014-10-17 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61605

vries at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from vries at gcc dot gnu.org ---
Patches committed, test-case updated. Resolving as fixed.


[Bug fortran/63570] New: [F2015] Implement 13.7.137 RANDOM INIT (REPEATABLE, IMAGE DISTINCT)

2014-10-17 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63570

Bug ID: 63570
   Summary: [F2015] Implement 13.7.137 RANDOM INIT (REPEATABLE,
IMAGE DISTINCT)
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org

See: "13.7.137 RANDOM INIT (REPEATABLE, IMAGE DISTINCT)"
at (currently) http://j3-fortran.org/doc/year/14/14-007r2.pdf


[Bug tree-optimization/63568] Missed optimization (a & ~mask) | (b & mask) = a ^ ((a ^ b) & mask)

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63568

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-10-17
 CC||rguenth at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Looks like three vs. four ops and thus is simpler in general.  Easy to
implement
as simplification on match-and-simplify branch.


[Bug ipa/63571] New: Local functions with only local aliases not regparm optimized on i686-linux

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63571

Bug ID: 63571
   Summary: Local functions with only local aliases not regparm
optimized on i686-linux
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org, jakub at gcc dot gnu.org,
jakub at redhat dot com, mliska at suse dot cz, uros at gcc 
dot gnu.org
Depends on: 63566

+++ This bug was initially created as a clone of Bug #63566 +++

#define A \
  x += y * z; \
  y = (y << ((z & 2) + 1)) \
  ^ (y >> (__SIZEOF_INT__ * __CHAR_BIT__ - (z & 2) - 1)); \
  z *= 7;
#define B A A A A A A A A A A
#define C B B B B B B B B B B

static unsigned int
f2 (unsigned int x, unsigned int y, unsigned int z)
{
  C
  return x + y + z;
}

static __typeof (f2) f1 __attribute__((alias ("f2")));

__attribute__((noinline, noclone)) unsigned int
f3 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (x, z, y) + 6;
}

__attribute__((noinline, noclone)) unsigned int
f4 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y, x, z) + 7;
}

__attribute__((noinline, noclone, used)) unsigned int
f5 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (2 * x, z / 2, y + 3) - 6;
}

__attribute__((noinline, noclone, used)) unsigned int
f6 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y + 2, x | 1, z / 73) + 1;
}

int
main ()
{
  unsigned int x = f3 (0x173214, 0x182172, 0x9314);
  unsigned int y = f4 (0x173214, 0x182172, 0x9314);
#if __SIZEOF_INT__ * __CHAR_BIT__ == 32
  if (x != 0xd8e56f78U || y != 0x494c6699U)
__builtin_abort ();
#endif
  return 0;
}

on i?86 -m32 -O2 doesn't use regparm calling convention for f1/f2, because f2
has alias, but as all the aliases are local too, there is no reason why it
couldn't be optimized too.

And the PR63566 testcase should for ICF merging use local regparm calling
convention too.


[Bug bootstrap/63536] [5 Regression] bootstrap failed when configured with --with-cpu=slm

2014-10-17 Thread izamyatin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63536

Igor Zamyatin  changed:

   What|Removed |Added

 CC||izamyatin at gmail dot com

--- Comment #6 from Igor Zamyatin  ---
Should be fixed now


[Bug debug/63572] New: [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

Bug ID: 63572
   Summary: [5 Regression] ICF breaks user debugging experience
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org, jakub at gcc dot gnu.org,
jakub at redhat dot com, mliska at suse dot cz, uros at gcc 
dot gnu.org
Depends on: 63566
Blocks: 63571

+++ This bug was initially created as a clone of Bug #63566 +++

On -O2 -g:
#define A \
  x += y * z; \
  y = (y << ((z & 2) + 1)) \
  ^ (y >> (__SIZEOF_INT__ * __CHAR_BIT__ - (z & 2) - 1)); \
  z *= 7;
#define B A A A A A A A A A A
#define C B B B B B B B B B B

static unsigned int
f1 (unsigned int x, unsigned int y, unsigned int z)
{
  C
  return x + y + z;
}

static unsigned int
f2 (unsigned int x, unsigned int y, unsigned int z)
{
  C
  return x + y + z;
}

__attribute__((noinline, noclone)) unsigned int
f3 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (x, z, y) + 6;
}

__attribute__((noinline, noclone)) unsigned int
f4 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y, x, z) + 7;
}

__attribute__((noinline, noclone, used)) unsigned int
f5 (unsigned int x, unsigned int y, unsigned int z)
{
  return f1 (2 * x, z / 2, y + 3) - 6;
}

__attribute__((noinline, noclone, used)) unsigned int
f6 (unsigned int x, unsigned int y, unsigned int z)
{
  return f2 (y + 2, x | 1, z / 73) + 1;
}

int
main ()
{
  unsigned int x = f3 (0x173214, 0x182172, 0x9314);
  unsigned int y = f4 (0x173214, 0x182172, 0x9314);
#if __SIZEOF_INT__ * __CHAR_BIT__ == 32
  if (x != 0xd8e56f78U || y != 0x494c6699U)
__builtin_abort ();
#endif
  return 0;
}

GCC emits incomplete DW_TAG_GNU_call_site DIEs for the f1 calls (that have been
optimized into ICF alias to f2) - no DW_AT_abstract_origin is provided,
and does not emit any DW_TAG_subprogram for f1 at all, just f2.
The question is how exactly do we want to emit the DW_TAG_subprogram for
icf_merged aliases.  Name/abstract origin/function type/names of arguments must
be it's own, I guess ICF will happily merge functions where the arguments have
e.g. different argument names, or different DECL_ABSTRACT_ORIGIN etc.
My question is mainly about DW_TAG_lexical_block/DW_TAG_inlined_subroutine, but
as even names of local variables can differ, or it can have different functions
inlined, I bet we need to fully populate DW_TAG_subprogram for the ICF aliases,
and have some mapping between BLOCKs in the ICF alias and BLOCKs in the kept
definition, so that we can reconstruct ranges.  Then, when we emit
DW_TAG_subprogram details for the kept original function definition when
finalizing its RTL, we also need to handle similarly all the ICF aliases.
Which is going to be non-fun.  Also, supposedly not just that, but we also need
a way to track multiple locations, not just blocks.
E.g. in one function, first 3 statements can have one location_t, say line 31,
and last 3 statements can have another location_t, say line 38.  Now, in
another
function ICF merged with that, the similar first 2 statements can have one
location_t, say line 47, the second 2 statements can have location_t line 49
and last 2 statements location_t line 53.  So, it might be impossible to create
e.g. a pointer_map from one set of locations to another set, we'd need to
analyze the correspondence between location_t's in between all the spots in the
function (gimple_location, EXPR_LOCATION) where they appear, and perhaps create
some artificial locations to make sure there is a 1-1 mapping between all ICF
merged functions.  Another problem is that we emit these days .debug_line using
.file/.loc directives and gas constructs that.  Not sure if we can have
multiple .debug_line proglets describing the same area of code (perhaps we need
some DWARF extension for that?) and if we had that possibility, the question is
how to emit it.
As for the DW_AT_abstract_origin of DW_TAG_GNU_call_site, that should probably
be just very easy, if there is a DIE for the ICF merged alias, supposedly it
will be found normally.

And, then we'll certainly need some GDB changes (and systemtap/elfutils etc.) - 
if some code range has multiple DW_TAG_subprogram DIEs covering that range,
e.g. if you want to put a breakpoint into a line in one of the functions


[Bug libstdc++/51772] --enable-clocale=generic makes unsafe assumptions about ctype_base::mask

2014-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51772

--- Comment #4 from Jonathan Wakely  ---
In config/locale/newlib/ctype_members.cc:

  default:
// Different from the generic version, xdigit and print in
// newlib are defined as bitwise-OR result of bitmasks:
//   xdigit = _X | _N;
//   print  = _P | _U | _L | _N | _B;
// in which _X and _B don't correspond to any ctype mask.
// In order to get the wmask correctly converted when __m is
// equal to _X or _B, the two cases are specifically handled
// here.
if (__m & xdigit)
  __ret = wctype("xdigit");
else if (__m & print)
  __ret = wctype("print");
else
  __ret = __wmask_type();
  }

This doesn't only apply to the masks defined in config/os/newlib/ctype_base.h,
but also netbsd and openbsd and bionic.

Something similar is also needed for qnx, as config/os/qnx/qnx6.1/ctype_base.h
uses several bitmasks that do not correspond to any ctype, e.g. _XA, _SP, _XS,
_XB


[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

--- Comment #1 from Richard Biener  ---
For debugging most important is to get

(gdb) b foo

still work when foo was merged with bar and the program now calls bar

Similarly nice (but probably impossible) is

(gdb) b foo.c:23

with foo.c:23 inside foo.  Of course foo and bar, even if considered equal
by ICF, are by no means equivalent lexically.  So foo.c:23 could at most
break at the start of bar.  (or give a useful diagnostic from gdb)


[Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support

2014-10-17 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513

--- Comment #35 from Oleg Endo  ---
Created attachment 33745
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33745&action=edit
Use SImode for FPSCR, add __builtin_sh_get_fpscr, __builtin_sh_set_fpscr

So I ended up removing the usage of PSImode for FPSCR and using SImode instead.
 I've tested this patch on r216173, together with the already applied
attachment 33727 patch, with -m4 -ml and -m4 -mb.  There is one new failure:

FAIL: gcc.c-torture/execute/20021120-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (internal compiler error)

error: insn does not satisfy its constraints:
(insn 1491 1489 1176 5 (set (reg:SI 12 r12)
(plus:SI (reg:SI 13 r13)
(const_int 24 [0x18]))) 20021120-1.c:39 76 {*addsi3_compact}
 (nil))


20021120-1.c:58:1: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:415
0x8565017 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc-trunk2/gcc/rtl-error.c:110
0x8565055 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc-trunk2/gcc/rtl-error.c:121
0x850c0cc reload_cse_simplify_operands
../../gcc-trunk2/gcc/postreload.c:415
0x850e5ea reload_cse_simplify
../../gcc-trunk2/gcc/postreload.c:127
0x850e5ea reload_cse_regs_1
../../gcc-trunk2/gcc/postreload.c:224
0x850e6a2 reload_cse_regs
../../gcc-trunk2/gcc/postreload.c:72
0x850e6a2 execute
../../gcc-trunk2/gcc/postreload.c:2348


At that place, reload it's trying to stuff with the fpu_switch insn:

(insn 293 1480 1173 5 (parallel [
(set (mem/c:DF (reg:SI 12 r12) [4 %sfp+-344 S8 A32])
(reg:DF 70 fr6))
(use (reg:SI 154 fpscr0))
(clobber (scratch:SI))
]) 20021120-1.c:39 289 {movdf_i4}
 (nil))
(insn 1173 293 1483 5 (parallel [
(set (reg:SI 12 r12)
(reg/v:SI 151 ))
(use (reg:SI 155 fpscr1))
(use (reg:SI 154 fpscr0))
(set (reg:SI 155 fpscr1)
(unspec_volatile:SI [
(const_int 0 [0])
] UNSPECV_FPSCR_STAT))
(set (reg:SI 154 fpscr0)
(unspec_volatile:SI [
(const_int 0 [0])
] UNSPECV_FPSCR_MODES))
]) 20021120-1.c:39 434 {fpu_switch}
 (nil))
(insn 1483 1173 1484 5 (set (reg:SI 13 r13)
(const_int 252 [0xfc])) 20021120-1.c:39 258 {movsi_ie}
 (nil))
(insn 1484 1483 1485 5 (set (reg:SI 13 r13)
(plus:SI (reg:SI 13 r13)
(reg/f:SI 15 r15))) 20021120-1.c:39 76 {*addsi3_compact}
 (expr_list:REG_EQUIV (plus:SI (reg/f:SI 15 r15)
(const_int 252 [0xfc]))
(nil)))
(insn 1485 1484 1174 5 (set (mem/c:SI (plus:SI (reg:SI 13 r13)
(const_int 24 [0x18])) [4 %sfp+-76 S4 A32])
(reg:SI 12 r12)) 20021120-1.c:39 258 {movsi_ie}
 (nil))
(note 1174 1485 1490 5 NOTE_INSN_DELETED)
(insn 1490 1174 1175 5 (set (reg:SI 13 r13)
(const_int 524288 [0x8])) 20021120-1.c:39 258 {movsi_ie}
 (nil))
(insn 1175 1490 1487 5 (set (reg:SI 12 r12)
(xor:SI (reg:SI 12 r12)
(reg:SI 13 r13))) 20021120-1.c:39 138 {*xorsi3_compact}
 (nil))
(insn 1487 1175 1488 5 (set (reg:SI 13 r13)
(const_int 252 [0xfc])) 20021120-1.c:39 258 {movsi_ie}
 (nil))
(insn 1488 1487 1489 5 (set (reg:SI 13 r13)
(plus:SI (reg:SI 13 r13)
(reg/f:SI 15 r15))) 20021120-1.c:39 76 {*addsi3_compact}
 (expr_list:REG_EQUIV (plus:SI (reg/f:SI 15 r15)
(const_int 252 [0xfc]))
(nil)))
(insn 1489 1488 1491 5 (set (mem/c:SI (plus:SI (reg:SI 13 r13)
(const_int 24 [0x18])) [4 %sfp+-76 S4 A32])
(reg:SI 12 r12)) 20021120-1.c:39 258 {movsi_ie}
 (nil))
(insn 1491 1489 1176 5 (set (reg:SI 12 r12)
(plus:SI (reg:SI 13 r13)
(const_int 24 [0x18]))) 20021120-1.c:39 76 {*addsi3_compact}
 (nil))
(insn 1176 1491 1496 5 (parallel [
(set (reg/v:SI 151 )
(mem/c:SI (reg:SI 12 r12) [4 %sfp+-76 S4 A32]))
(use (reg:SI 155 fpscr1))
(use (reg:SI 154 fpscr0))
(set (reg:SI 155 fpscr1)
(unspec_volatile:SI [
(const_int 0 [0])
] UNSPECV_FPSCR_STAT))
(set (reg:SI 154 fpscr0)
(unspec_volatile:SI [
(const_int 0 [0])
] UNSPECV_FPSCR_MODES))
]) 20021120-1.c:39 434 {fpu_switch}
 (nil))
(insn 1496 1176 1497 5 (set (reg:SI 12 r12)
(const_int 16 [0x10])) 20021120-1.c:39 258 {movsi_ie}
 (nil))


Summary:

insn 1173 stores the fpscr to r12

the mode switch (xor op) is done on r12

insn 1489 writes r12 (new fpscr value) on the stack

insn 1491 tries to recalculate the stack address and put it into r12, to
satisfy the memory constraints of fpu_switch (which now accepts post-inc load
and 

[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-10-17
 CC||ccoutant at gcc dot gnu.org,
   ||jan.kratochvil at redhat dot 
com,
   ||jason at gcc dot gnu.org,
   ||mark at gcc dot gnu.org
   Target Milestone|--- |5.0
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
For the different locations and blocks, I meant something like:

struct S { int a; int b; int c; };
struct T { int d; int e; int f; };

static int
f1 (struct S *x)
{
  int g = x->a * 7;
  {
int h = x->b * 11;
{
  int i = x->c;
  return g + h + i;
}
  }
}

static int
f2 (struct T *x)
{
  int j = x->d * 7; int k = x->e * 11;
  int l = x->f;
  return j + k + l;
}

int f3 (struct S *x) { return f1 (x); }
int f4 (struct T *x) { return f2 (x); }
int f5 (struct S *x) { return f1 (x) + 1; }
int f6 (struct T *x) { return f2 (x) + 1; }

(but for some reason ICF doesn't merge this, so we need better testcase).
The point was that with identical .text there doesn't have to be 1:1 mapping
between location_t's (and those now include both file:line:column and BLOCK),
in the above example supposedly there is many:1 mapping from f2 to f1
location_t, but generally there could be overlaps etc.


[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #3 from Markus Trippelsdorf  ---
*** Bug 63562 has been marked as a duplicate of this bug. ***


[Bug ipa/63562] [5 Regression] ICE : in ipcp_verify_propagated_values, at ipa-cp.c:907

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63562

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #3 from Markus Trippelsdorf  ---
dup.

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


[Bug ipa/63566] [5 Regression] i686 bootstrap fails: ICE RTL flag check: INSN_UID used with unexpected rtx code 'set' in INSN_UID, at rtl.h:1326

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63566

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #6 from Markus Trippelsdorf  ---
*** Bug 63562 has been marked as a duplicate of this bug. ***


[Bug ipa/63562] [5 Regression] ICE : in ipcp_verify_propagated_values, at ipa-cp.c:907

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63562

--- Comment #4 from Markus Trippelsdorf  ---
dup.

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


[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

--- Comment #4 from Jakub Jelinek  ---
Better testcase, where ICF actually happens.

struct S { int a; int b; int c; };

__attribute__((noinline)) static int
f1 (struct S *x)
{
  static int u = 1;
  int g = x->a * 7;
  {
static int v = 2;
int h = x->b * 11;
int i = x->c;
return g + h + i;
  }
}

__attribute__((noinline)) static int
f2 (struct S *x)
{
  static int w = 3;
  int j = x->a * 7; int k = x->b * 11;
  {
static int y = 4;
int l = x->c;
return j + k + l;
  }
}

__attribute__((noinline)) int f3 (struct S *x) { return f1 (x); }
__attribute__((noinline)) int f4 (struct S *x) { return f2 (x) + 1; }
__attribute__((noinline)) int f5 (struct S *x) { return f1 (x) + 2; }
__attribute__((noinline)) int f6 (struct S *x) { return f2 (x) + 3; }

int
main ()
{
  struct S s = { 1, 2, 3 };
  asm volatile ("" : : "r" (&s) : "memory");
  int a[4];
  a[0] = f3 (&s);
  a[1] = f4 (&s);
  a[2] = f5 (&s);
  a[3] = f6 (&s);
  asm volatile ("" : : "r" (a) : "memory");
  return 0;
}

As for .debug_line, the only solution which doesn't require any extensions
would be IMHO to put the icf_merged clone's DW_TAG_subprogram into its own
DW_TAG_partial_unit, import it into the DW_TAG_compile_unit where it is needed,
and use a different DW_AT_stmt_list offset in there, and emit part of
.debug_line (the one for the icf_merged aliases) manually into .debug_line by
the compiler and see whether the assembler will deal with it properly.

Anyway, the ideal user debugging experience IMHO with the above testcase is:
b f1 - debugger finds out that f1 and f2 subprograms have overlapping ranges,
puts a breakpoint into f1==f2 prologue, and when the breakpoint is hit,
unwinds, checks if from the backtrace it is possible using DW_TAG_GNU_call_site
figure out which of the functions has been called; if it is, depending on if it
is f1 or f2 either honors or ignores the breakpoint; if it isn't possible to
uniquely identify what the caller meant to call, honor the breakpoint.
To map instructions back to line info, blocks etc., again, check unwind
info/backtrace which function it is, if it is known which one it is, go into
.debug_line table corresponding to the CU/PU of the subprogram, otherwise pick
one.  Ditto for the
DW_TAG_subprogram/DW_TAG_lexical_block/DW_TAG_inlined_subroutine trees.

Does that sound like a plan?


[Bug bootstrap/63573] New: [5 Regression] libgo: ICE building libgo on powerpc-linux-gnu

2014-10-17 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63573

Bug ID: 63573
   Summary: [5 Regression] libgo: ICE building libgo on
powerpc-linux-gnu
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org

libgo ftbfs on trunk r216349 on powerpc-linux-gnu:

../../../src/libgo/go/path/filepath/path.go: In function 'filepath.ToSlash':
../../../src/libgo/go/path/filepath/path.go:158:1: internal compiler error: in
expand_expr_addr_expr_1, at expr.c:7669
 func ToSlash(path string) string {
 ^
Please submit a full bug report,
with preprocessed source if appropriate.


[Bug bootstrap/63574] New: [5 Regression] ICE building libjava (segfault) on arm-linux-gnueabihf

2014-10-17 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63574

Bug ID: 63574
   Summary: [5 Regression] ICE building libjava (segfault) on
arm-linux-gnueabihf
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org

libjava ftbfs on trunk r216349, last successful build seen on 20140919

../../../src/libjava/sun/misc/natUnsafe.cc  -fPIC -DPIC -o
sun/misc/.libs/natUnsafe.o
../../../src/libjava/sun/misc/natUnsafe.cc:253:1: internal compiler error:
Segmentation fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.

configured for armv7-a hard-float, thumb mode.


[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

Jakub Jelinek  changed:

   What|Removed |Added

 CC|jakub at redhat dot com|

--- Comment #5 from Jakub Jelinek  ---
struct S { int a; int b; int c; };
volatile int t;

__attribute__((noinline)) static int
f1 (struct S *x)
{
  static int u = 1;
  int g = x->a * 7;
  t++;
  {
static int v = 2;
int h = x->b * 11;
t++;
int i = x->c;
t++;
return g + h + i;
  }
}

__attribute__((noinline)) static int
f2 (struct S *x)
{
  static int w = 3;
  int j = x->a * 7; t++; int k = x->b * 11; t++;
  {
static int y = 4;
int l = x->c;
t++;
return j + k + l;
  }
}

__attribute__((noinline)) int f3 (struct S *x) { return f1 (x); }
__attribute__((noinline)) int f4 (struct S *x) { return f2 (x) + 1; }
__attribute__((noinline)) int f5 (struct S *x) { return f1 (x) + 2; }
__attribute__((noinline)) int f6 (struct S *x) { return f2 (x) + 3; }

int
main ()
{
  struct S s = { 1, 2, 3 };
  asm volatile ("" : : "r" (&s) : "memory");
  int a[4];
  a[0] = f3 (&s);
  a[1] = f4 (&s);
  a[2] = f5 (&s);
  a[3] = f6 (&s);
  asm volatile ("" : : "r" (a) : "memory");
  return 0;
}

Even better testcase, which actually has more executable statements, and thus
allows to inspect if one sees e.g. the u/v/w/y/g/h/i/j/k/l variables in the
scope etc.


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

2014-10-17 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

Oleg Endo  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #5 from Oleg Endo  ---
Richard, any chance this might get fixed with the match-and-simplify branch?


[Bug ipa/63575] New: [5 Regression] ICF miscompiles libstdc++

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63575

Bug ID: 63575
   Summary: [5 Regression] ICF miscompiles libstdc++
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
CC: mliska at suse dot cz

I see lots of libstdc++ regressions on glibc 2.18 (openSUSE 13.1) and glibc
2.11.3 (SLE11 SP1) systems and 32bit testing on x86_64-linux:

FAIL: 21_strings/basic_string/modifiers/replace/char/1.cc execution test
FAIL: 21_strings/basic_string/modifiers/replace/wchar_t/1.cc execution test
FAIL: 21_strings/basic_string/operations/substr/char/1.cc execution test
FAIL: 21_strings/basic_string/operations/substr/wchar_t/1.cc execution test
FAIL: 22_locale/money_put/put/char/9780-3.cc execution test
FAIL: 22_locale/numpunct/members/pod/2.cc execution test
FAIL: 22_locale/time_put/put/char/9780-1.cc execution test
FAIL: 23_containers/deque/allocator/copy.cc execution test
FAIL: 23_containers/map/modifiers/erase/dr130-linkage-check.cc execution test
FAIL: 23_containers/multimap/modifiers/erase/dr130-linkage-check.cc execution
test
FAIL: 23_containers/multiset/modifiers/erase/dr130-linkage-check.cc execution
test
FAIL: 23_containers/multiset/modifiers/insert/1.cc execution test
FAIL: 23_containers/set/modifiers/erase/dr130-linkage-check.cc execution test
FAIL: 23_containers/unordered_set/hash_policy/rehash.cc execution test
FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test
FAIL: 23_containers/unordered_set/max_load_factor/robustness.cc execution test
FAIL: 23_containers/unordered_set/modifiers/swap.cc execution test
FAIL: 23_containers/vector/ext_pointer/types/2.cc execution test
FAIL: 25_algorithms/is_heap/1.cc execution test
FAIL: 25_algorithms/is_heap_until/1.cc execution test
FAIL: 26_numerics/complex/inserters_extractors/char/1.cc execution test
FAIL: 26_numerics/complex/inserters_extractors/wchar_t/1.cc execution test
XPASS: 26_numerics/headers/cmath/c_math.cc execution test
FAIL: 28_regex/algorithms/regex_match/awk/cstring_01.cc execution test
FAIL: 28_regex/algorithms/regex_match/basic/empty_range.cc execution test
FAIL: 28_regex/algorithms/regex_match/ecma/char/58576.cc execution test
FAIL: 28_regex/algorithms/regex_match/ecma/char/backref.cc execution test
FAIL: 28_regex/algorithms/regex_match/ecma/char/empty_range.cc execution test
FAIL: 28_regex/algorithms/regex_match/ecma/char/quoted_char.cc execution test
FAIL: 28_regex/algorithms/regex_match/ecma/char/ungreedy.cc execution test
FAIL: 28_regex/algorithms/regex_match/extended/cstring_bracket_01.cc execution
test
FAIL: 28_regex/algorithms/regex_replace/char/basic_replace.cc execution test
FAIL: 28_regex/algorithms/regex_search/61720.cc execution test
FAIL: 28_regex/algorithms/regex_search/ecma/assertion.cc execution test
FAIL: 28_regex/algorithms/regex_search/ecma/flags.cc execution test
FAIL: 28_regex/algorithms/regex_search/ecma/greedy.cc execution test
FAIL: 28_regex/iterators/regex_iterator/char/string_01.cc execution test
FAIL: 28_regex/iterators/regex_iterator/wchar_t/string_01.cc execution test
FAIL: 28_regex/iterators/regex_token_iterator/char/string_01.cc execution test
FAIL: 28_regex/iterators/regex_token_iterator/wchar_t/string_01.cc execution
test
FAIL: 28_regex/match_results/format.cc execution test
FAIL: experimental/any/cons/3.cc execution test
FAIL: experimental/optional/relops/3.cc execution test
FAIL: ext/pb_ds/regression/hash_map_rand.cc execution test
FAIL: ext/pb_ds/regression/hash_set_rand.cc execution test
FAIL: ext/pb_ds/regression/list_update_map_rand.cc execution test
FAIL: ext/pb_ds/regression/list_update_set_rand.cc execution test
FAIL: ext/pb_ds/regression/priority_queue_rand.cc execution test
FAIL: ext/pb_ds/regression/trie_map_rand.cc execution test
FAIL: ext/pb_ds/regression/trie_set_rand.cc execution test
FAIL: ext/random/uniform_on_sphere_distribution/operators/generate.cc execution
test
FAIL: ext/random/uniform_on_sphere_distribution/operators/serialize.cc
execution test
FAIL: ext/vstring/modifiers/pop_back/char/1.cc execution test
FAIL: ext/vstring/modifiers/pop_back/wchar_t/1.cc execution test
WARNING: program timed out.
WARNING: program timed out.
WARNING: program timed out.
WARNING: program timed out.
WARNING: program timed out.
WARNING: program timed out.

See for example also
https://gcc.gnu.org/ml/gcc-regression/2014-10/msg00389.html

Note that I cannot reproduce the FAILs in a not bootstrapped tree which means
that libstdc++ itself must be miscompiled.


[Bug ipa/63575] [5 Regression] ICF miscompiles libstdc++

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63575

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug tree-optimization/63302] [4.9 Regression] Code with 64-bit long long constants is miscompiled on 32-bit host

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63302

--- Comment #23 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 17 10:50:16 2014
New Revision: 216391

URL: https://gcc.gnu.org/viewcvs?rev=216391&root=gcc&view=rev
Log:
PR tree-optimization/63302
* tree-ssa-reassoc.c (optimize_range_tests_xor,
optimize_range_tests_diff): Use !integer_pow2p () instead of
tree_log2 () < 0.

* gcc.c-torture/execute/pr63302.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr63302.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-reassoc.c


[Bug tree-optimization/63302] [4.9 Regression] Code with 64-bit long long constants is miscompiled on 32-bit host

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63302

--- Comment #24 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 17 10:53:36 2014
New Revision: 216392

URL: https://gcc.gnu.org/viewcvs?rev=216392&root=gcc&view=rev
Log:
PR tree-optimization/63302
* tree-ssa-reassoc.c (optimize_range_tests_xor,
optimize_range_tests_diff): Use !integer_pow2p () instead of
tree_log2 () < 0.

* gcc.c-torture/execute/pr63302.c: New test.

Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr63302.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
branches/gcc-4_9-branch/gcc/tree-ssa-reassoc.c


[Bug tree-optimization/63464] compare one character to many: faster

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63464

--- Comment #13 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 17 10:54:54 2014
New Revision: 216393

URL: https://gcc.gnu.org/viewcvs?rev=216393&root=gcc&view=rev
Log:
PR tree-optimization/63464
* gimple.h (gimple_seq_discard): New prototype.
* gimple.c: Include stringpool.h and tree-ssanames.h.
(gimple_seq_discard): New function.
* optabs.h (lshift_cheap_p): New prototype.
* optabs.c (lshift_cheap_p): New function, moved from...
* tree-switch-conversion.c (lshift_cheap_p): ... here.
* tree-ssa-reassoc.c: Include gimplify.h and optabs.h.
(reassoc_branch_fixups): New variable.
(update_range_test): Add otherrangep and seq arguments.
Unshare exp.  If otherrange is NULL, use for other ranges
array of pointers pointed by otherrangep instead.
Emit seq before gimplified statements for tem.
(optimize_range_tests_diff): Adjust update_range_test
caller.
(optimize_range_tests_xor): Likewise.  Fix up comment.
(extract_bit_test_mask, optimize_range_tests_to_bit_test): New
functions.
(optimize_range_tests): Adjust update_range_test caller.
Call optimize_range_tests_to_bit_test.
(branch_fixup): New function.
(execute_reassoc): Call branch_fixup.

* gcc.dg/torture/pr63464.c: New test.
* gcc.dg/tree-ssa/reassoc-37.c: New test.
* gcc.dg/tree-ssa/reassoc-38.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr63464.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/reassoc-37.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/reassoc-38.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.c
trunk/gcc/gimple.h
trunk/gcc/optabs.c
trunk/gcc/optabs.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-reassoc.c
trunk/gcc/tree-switch-conversion.c


[Bug tree-optimization/63302] [4.9 Regression] Code with 64-bit long long constants is miscompiled on 32-bit host

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63302

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #25 from Jakub Jelinek  ---
Should be fixed now.


[Bug tree-optimization/63464] compare one character to many: faster

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63464

Jakub Jelinek  changed:

   What|Removed |Added

 CC||uros at gcc dot gnu.org

--- Comment #14 from Jakub Jelinek  ---
Patch committed.  There is still an issue that remains, e.g. on vrp66.c
testcase
we often get code like:
  _120 = 3314649325744685057 >> _119;
  _121 = _120 & 1;
  _25 = _121 ^ 1;
  _122 = (_Bool) _25;
  if (_122 != 0)
when actually
  _120 = 3314649325744685057 >> _119;
  _121 = _120 & 1;
  if (_121 == 0)
would be enough and shorter.  And it isn't just a GIMPLE preference, it
actually
shows up in the generated code.  On vrp66.c on x86_64 at -O2, I'm seeing just
24 btq instructions (before the optimization 0) and 22 shrq instructions
(again, before 0), where the assembly typically looks like:
movabsq $-9223372032543031257, %rax
movl%edi, %ecx
shrq%cl, %rax
andl$1, %eax
xorq$1, %rax
andl$1, %eax
i.e. pretty much the same nonsense, at least the last andl $1 is redundant,
because the first andl ensures %eax is 0 or 1, the xorq turns that into 1 or 0
and so the second andl is useless.  It might be nicer if the code used btq/setc
instead.

So, supposedly there is something we want to match-and-simplify, perhaps also
something we want to simplify at the RTL level, and check if bt+set{,n}c might
not be beneficial here compared to the shift + and + xor.


[Bug middle-end/63184] [4.8/4.9/5 Regression] Fails to simplify comparison

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63184

--- Comment #2 from Richard Biener  ---
Ok, so we can (and do) forward addresses like &a[_9] into plain dereferences,
so lowering these addresses early is probably not a good idea.  We could
lower them as a very first thing in GIMPLE reassoc but that would still need
to apply transforms like (i + 1) * 4 -> i*4 + 4 to be most effective
(though that generally applies).

Otherwise I can't see an easy place to hook in simplification of

  i.0_3 = i;
  _4 = i.0_3 * 4;
  _5 = (sizetype) _4;
  _6 = _5 + 4;
  _7 = &a[1] + _6;
  _9 = i.0_3 + 2;
  _10 = &a[_9];
  if (_7 != _10)

which is what we get for the first testcase after initial scalar cleanups.
SLSR helps somewhat in some cases but it's run very late.

We could detect address comparisons with the same base and use the
affine combination machinery to simplify them though.  From somewhere.
tree-ssa-forwprop.c probably.  Simplify them to _7 - _10 CMP 0 (if
the addresses have the same base object at least that should cancel).
We canonicalize (base p+ off1) p+ off2 to base p+ (off1 + off2) which
should help here as well.

We could also only "fold" away the base object from the chain (not using
the affine machinery).  match-and-simplify doesn't help here because
the replacement involves an expression created by get_inner_reference
(well, a manual transform would work here, of course).


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

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56365

--- Comment #6 from Richard Biener  ---
No, that doesn't handle PHI nodes.  phiopt needs to be improved to handle
merged PHIs for this case.


[Bug tree-optimization/63464] compare one character to many: faster

2014-10-17 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63464

--- Comment #15 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #14)

> So, supposedly there is something we want to match-and-simplify, perhaps
> also something we want to simplify at the RTL level, and check if
> bt+set{,n}c might not be beneficial here compared to the shift + and + xor.

Generation of "bt" is quite fragile and heavily depends on combiner to do its
job correctly. IIRC, there were some talks to introduce bit-test tree code (and
corresponding RTX ?) to enable further optimizations. Something like how bswap
is now handled throughout the compilation.

[Bug ipa/63575] [5 Regression] ICF miscompiles libstdc++

2014-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63575

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #1 from Richard Biener  ---
Seems to be fixed with

2014-10-17  Martin Liska  

* ipa-icf.c (sem_function::merge): Local flags are set to false
to enforce equal calling convention to be used.
* opts.c (common_handle_option): Indentation fix.


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #24 from Stupachenko Evgeny  ---
We are able to reproduce the bug.
SET_GOT removed as the only use of GOT register was hidden by:
(insn 37 34 38 6 (set (mem:TF (pre_dec:SI (reg/f:SI 7 sp)) [0  S16 A8]) 
(const_double:TF 2.0769187434139310514121985316880384e+34
[0x0.8p+115])) frexpq.c:1316 121 {*pushtf} 
 (expr_list:REG_ARGS_SIZE (const_int 16 [0x10]) 
(nil))) 

The solution is not to delete SET_GOT till reload.


[Bug rtl-optimization/63463] [5.0 regression] FAIL: gnat.dg/regpat1.adb execution test

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63463
Bug 63463 depends on bug 63404, which changed state.

Bug 63404 Summary: [5 Regression] gcc 5 miscompiles linux block layer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63404

   What|Removed |Added

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


[Bug target/63404] [5 Regression] gcc 5 miscompiles linux block layer

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63404

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #13 from Markus Trippelsdorf  ---
Fixed.


[Bug tree-optimization/63563] [4.9/5 Regression] ICE: in vectorizable_store, at tree-vect-stmts.c:5106 with -mavx2

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63563

Markus Trippelsdorf  changed:

   What|Removed |Added

   Target Milestone|--- |4.9.2


[Bug tree-optimization/63302] [4.9 Regression] Code with 64-bit long long constants is miscompiled on 32-bit host

2014-10-17 Thread dave.anglin at bell dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63302

--- Comment #26 from dave.anglin at bell dot net ---
On 17-Oct-14, at 7:10 AM, jakub at gcc dot gnu.org wrote:

> Should be fixed now.

Thanks, Jakub.

Dave
--
John David Anglindave.ang...@bell.net


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #25 from Iain Sandoe  ---
Created attachment 33746
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33746&action=edit
RTL dumps

This is trunk rev 216304 + change to i386.md.
-O2 -m32.

For O0/1 the output is created OK.
For O2 the picbase is being optimised away.

(this was with a stage#1 compiler built -O0 -g3 using a GCC-4.9 bootstrap).


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #26 from Iain Sandoe  ---
(In reply to Stupachenko Evgeny from comment #24)
> We are able to reproduce the bug.
> SET_GOT removed as the only use of GOT register was hidden by:
> (insn 37 34 38 6 (set (mem:TF (pre_dec:SI (reg/f:SI 7 sp)) [0  S16 A8]) 
> (const_double:TF 2.0769187434139310514121985316880384e+34
> [0x0.8p+115])) frexpq.c:1316 121 {*pushtf} 
>  (expr_list:REG_ARGS_SIZE (const_int 16 [0x10]) 
> (nil))) 
> 
> The solution is not to delete SET_GOT till reload.

cool! 
sorry I didn't see that before making my post…
.. are you working up a patch?

[Bug tree-optimization/61773] [5 Regression] ICE in tree-ssa-strlen.c:417

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61773

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-10-17
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #5 from Markus Trippelsdorf  ---
Also happens during PGO/LTO bootstrap:

markus@x4 gcc % /var/tmp/gcc_build_dir/./stage1-gcc/xg++
-B/var/tmp/gcc_build_dir/./stage1-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/
-nostdinc++
-B/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/stage1-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-march=native -O3 -pipe -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-DHAVE_CONFIG_H -DGENERATOR_FILE
-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections,--icf=safe,--icf-iterations=3
-o build/gengtype build/gengtype.o build/errors.o build/gengtype-lex.o
build/gengtype-parse.o build/gengtype-state.o build/version.o
.././libiberty/libiberty.a
../../gcc/gcc/gengtype.c: In function ‘output_mangled_typename’:
../../gcc/gcc/gengtype.c:2625:1: internal compiler error: in get_string_length,
at tree-ssa-strlen.c:417
 output_mangled_typename (outf_p of, const_type_p t)
 ^
Please submit a full bug report,

[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

--- Comment #6 from Martin Liška  ---
There's how gold's ICF works for test attached by Jakub:

gcc --version:
gcc version 5.0.0 20141016 (experimental) (GCC) 

ld --version:
GNU gold (GNU Binutils 2.24.51.20141010) 1.11

$ gcc icf-gdb.c -c -g --function-sections
$ gcc icf-gdb.o -o a.out -Wl,--icf=all,--print-icf-sections
...
ld: ICF folding section '.text.f2' in file 'icf-gdb.o' into '.text.f1' in file
'icf-gdb.o'
...

dwarfdump a.ou shows:
< 1><0x0059>DW_TAG_subprogram
  DW_AT_name  f1
  DW_AT_decl_file 0x0001
/home/marxin/Programming/testcases/icf-gdb.c
  DW_AT_decl_line 0x0005
  DW_AT_prototypedyes(1)
  DW_AT_type  <0x0052>
  DW_AT_low_pc0x00400546
  DW_AT_high_pc   115
  DW_AT_frame_baselen 0x0001: 9c:
DW_OP_call_frame_cfa
  DW_AT_GNU_all_call_sitesyes(1)
  DW_AT_sibling   <0x00e2>


and:
< 1><0x00e8>DW_TAG_subprogram
  DW_AT_name  f2
  DW_AT_decl_file 0x0001
/home/marxin/Programming/testcases/icf-gdb.c
  DW_AT_decl_line 0x0015
  DW_AT_prototypedyes(1)
  DW_AT_type  <0x0052>
  DW_AT_low_pc0x00400546
  DW_AT_high_pc   115
  DW_AT_frame_baselen 0x0001: 9c:
DW_OP_call_frame_cfa
  DW_AT_GNU_all_call_sitesyes(1)
  DW_AT_sibling   <0x0171>

If I tried to put breakpoint in GDB to f2, breakpoint is triggered 4 times with
back-trace from all functions f3-f6.
Example:
#0  f1 (x=0x7fffda10) at icf-gdb.c:24
#1  0x004005d1 in f3 (x=0x7fffda10) at icf-gdb.c:33
#2  0x00400657 in main () at icf-gdb.c:44


Maybe I miss something, but gold also does not support correct DWARF merging.
I will create issue for gold.

Martin

[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

--- Comment #7 from Jakub Jelinek  ---
(In reply to Martin Liška from comment #6)
> There's how gold's ICF works for test attached by Jakub:
> 
> gcc --version:
> gcc version 5.0.0 20141016 (experimental) (GCC) 
> 
> ld --version:
> GNU gold (GNU Binutils 2.24.51.20141010) 1.11
> 
> $ gcc icf-gdb.c -c -g --function-sections
> $ gcc icf-gdb.o -o a.out -Wl,--icf=all,--print-icf-sections
> ...
> ld: ICF folding section '.text.f2' in file 'icf-gdb.o' into '.text.f1' in
> file 'icf-gdb.o'
> ...
> 
> dwarfdump a.ou shows:
> < 1><0x0059>DW_TAG_subprogram
>   DW_AT_name  f1
>   DW_AT_decl_file 0x0001
> /home/marxin/Programming/testcases/icf-gdb.c
>   DW_AT_decl_line 0x0005
>   DW_AT_prototypedyes(1)
>   DW_AT_type  <0x0052>
>   DW_AT_low_pc0x00400546
>   DW_AT_high_pc   115
>   DW_AT_frame_baselen 0x0001: 9c:
> DW_OP_call_frame_cfa
>   DW_AT_GNU_all_call_sitesyes(1)
>   DW_AT_sibling   <0x00e2>
> 
> 
> and:
> < 1><0x00e8>DW_TAG_subprogram
>   DW_AT_name  f2
>   DW_AT_decl_file 0x0001
> /home/marxin/Programming/testcases/icf-gdb.c
>   DW_AT_decl_line 0x0015
>   DW_AT_prototypedyes(1)
>   DW_AT_type  <0x0052>
>   DW_AT_low_pc0x00400546
>   DW_AT_high_pc   115
>   DW_AT_frame_baselen 0x0001: 9c:
> DW_OP_call_frame_cfa
>   DW_AT_GNU_all_call_sitesyes(1)
>   DW_AT_sibling   <0x0171>
> 
> If I tried to put breakpoint in GDB to f2, breakpoint is triggered 4 times
> with back-trace from all functions f3-f6.
> Example:
> #0  f1 (x=0x7fffda10) at icf-gdb.c:24
> #1  0x004005d1 in f3 (x=0x7fffda10) at icf-gdb.c:33
> #2  0x00400657 in main () at icf-gdb.c:44
> 
> 
> Maybe I miss something, but gold also does not support correct DWARF merging.
> I will create issue for gold.

Well, the debug info you get after ld ICF merging is better than what GCC
creates for ICF merging right now, though still not ideal, but as gold likely
doesn't want to rewrite debug info (which is costly operation), it can't do
much more than that, while GCC can.

As you can see above, at least you do have two separate DW_TAG_subprogram for
f1/f2, vars/lexical blocks/parameters/inline functions in them in a good shape.
Supposedly the DW_TAG_GNU_call_site info is present and correct too, so the
debugger has the option to find out in which function it is, but that doesn't
necessarily mean gdb has such support present.

What is broken with ld ICF merging is supposedly .debug_line, for both
functions you are pointed to the same portion of .debug_line, and that portion
contains two sets of line instructions for the same spots, not sure if it can
be considered valid or how would gdb be able to find out which function is
which in there.

[Bug debug/63572] [5 Regression] ICF breaks user debugging experience

2014-10-17 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63572

--- Comment #8 from Martin Liška  ---
Created attachment 33747
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33747&action=edit
Gold ICF dwarfdump

[Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support

2014-10-17 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513

--- Comment #36 from Oleg Endo  ---
(In reply to Oleg Endo from comment #35)
> Created attachment 33745 [details]
> Use SImode for FPSCR, add __builtin_sh_get_fpscr, __builtin_sh_set_fpscr
> 
> So I ended up removing the usage of PSImode for FPSCR and using SImode
> instead.  I've tested this patch on r216173, together with the already
> applied attachment 33727 [details] patch, with -m4 -ml and -m4 -mb.  There
> is one new failure:
> 
> FAIL: gcc.c-torture/execute/20021120-1.c   -O2 -flto -fuse-linker-plugin
> -fno-fat-lto-objects  (internal compiler error)
> 
> error: insn does not satisfy its constraints:
> (insn 1491 1489 1176 5 (set (reg:SI 12 r12)
> (plus:SI (reg:SI 13 r13)
> (const_int 24 [0x18]))) 20021120-1.c:39 76 {*addsi3_compact}
>  (nil))
> 
> 
> Summary:
> 
> insn 1173 stores the fpscr to r12
> 
> the mode switch (xor op) is done on r12
> 
> insn 1489 writes r12 (new fpscr value) on the stack
> 
> insn 1491 tries to recalculate the stack address and put it into r12, to
> satisfy the memory constraints of fpu_switch (which now accepts post-inc
> load and simple register address).
> 
> insn 1776 tries to load it from the stack
> 
> 
> Reload generates a wrong insn addsi3 insn.  Something similar was happening
> in PR 55212, too.

Disallowing memory operands (except pre-dec store, post-inc load for push,pop)
in the fpu_switch pattern fixes that failure.  Although it might result in less
optimal code in some cases where user code wants to store the current fpscr in
memory.  On the other hand, the generated memory address code in such cases is
not very good anyway.  Thus it's probably better to drop that for now.


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread evstupac at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #27 from Stupachenko Evgeny  ---
Created attachment 33748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33748&action=edit
Fix SET_GOT delete

The patch fix the problem.
Can you please run darwin bootstrap with it and previous (receivers patterns
delete)?
x86 is in progress.


[Bug target/63223] [avr] Make jumptables work with -Wl,--section-start,.text=

2014-10-17 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63223

Jorn Wolfgang Rennecke  changed:

   What|Removed |Added

 CC||amylaar at gcc dot gnu.org

--- Comment #4 from Jorn Wolfgang Rennecke  ---
(In reply to Georg-Johann Lay from comment #1)
> Author: gjl
> Date: Thu Sep 11 08:08:17 2014
> New Revision: 215152
> 
> URL: https://gcc.gnu.org/viewcvs?rev=215152&root=gcc&view=rev
> Log:
> gcc/
>   PR target/63223
>   * config/avr/avr.md (*tablejump.3byte-pc): New insn.
>   (*tablejump): Restrict to !AVR_HAVE_EIJMP_EICALL.  Add void clobber.
>   (casesi): Expand to *tablejump.3byte-pc if AVR_HAVE_EIJMP_EICALL.
> libgcc/
>   PR target/63223
>   * config/avr/libgcc.S (__tablejump2__): Rewrite to use RAMPZ, ELPM
>   and R24 as needed.  Make work for all devices and .text locations.
>   (__do_global_ctors, __do_global_dtors): Use word addresses.

do_global_dtors is supposed to start at the start and increment from there.
I see it used to be half-way wrong and half-way correct.
(Starting at the start, decrementing for __AVR_HAVE_ELPM__, incrementing
otherwise.)
However, you now made it all the way use an incorrect order - starting at the
end and incrementing from there.
Is there a rationale for this?

[Bug ipa/63576] New: [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Bug ID: 63576
   Summary: [5 Regression] ICE : in ipa_merge_profiles, at
ipa-utils.c:540 during Firefox LTO/PGO build
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
CC: marxin at gcc dot gnu.org

% wget trippelsdorf.de/testcase.tar.bz2
 % tar xvjf testcase.tar.bz2
 % g++ -w -march=amdfam10 -flto=4 -fprofile-use -fprofile-correction
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fno-math-errno
-std=gnu++0x -pipe -O3 Unified_cpp_js_src1.ii Unified_cpp_js_src2.ii
Unified_cpp_js_src3.ii  
lto1: internal compiler error: in ipa_merge_profiles, at ipa-utils.c:540
0x7f7d55 ipa_merge_profiles(cgraph_node*, cgraph_node*)
../../gcc/gcc/ipa-utils.c:540
0xf57883 ipa_icf::sem_function::merge(ipa_icf::sem_item*)
../../gcc/gcc/ipa-icf.c:625
0xf5cc86 ipa_icf::sem_item_optimizer::merge_classes(unsigned int)
../../gcc/gcc/ipa-icf.c:2241
0xf60bf9 ipa_icf::sem_item_optimizer::execute()
../../gcc/gcc/ipa-icf.c:1602
0xf61671 ipa_icf_driver
../../gcc/gcc/ipa-icf.c:2319
0xf61671 ipa_icf::pass_ipa_icf::execute(function*)
../../gcc/gcc/ipa-icf.c:2366
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions

-fno-ipa-icf "fixes" the issue.


[Bug target/63223] [avr] Make jumptables work with -Wl,--section-start,.text=

2014-10-17 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63223

--- Comment #5 from Jorn Wolfgang Rennecke  ---
I also observe that the cpi/cpc/brne idiom that is used throughout -
before and after your patch - is nonsentical.


[Bug fortran/63577] New: [4.8/4.9/5? Regression]: Huge compile time and memory usage with -O and not -fPIC

2014-10-17 Thread jfsoden at mpp dot mpg.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63577

Bug ID: 63577
   Summary: [4.8/4.9/5? Regression]: Huge compile time and memory
usage with -O and not -fPIC
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jfsoden at mpp dot mpg.de

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

The attached Fortran programs compiles slowly and needs lots of memory
if compiled with basic optimization (-O) but without -fPIC.
With -fPIC, memory usage and compile time are much shorter.


$ gfortran abbrevd408h0.f90 -c -O  
needs 45s and 630MB RAM

but

$ gfortran abbrevd408h0.f90 -c -O -fPIC
needs only 6s and 105MB RAM.

$ gfortran abbrevd408h0.f90 -c
works also quickly.

The attached file is shortened. On the full file, the effect is more distinct
(with gfortran 4.8.1: >8GB RAM usage, several minutes).

With gfortran 4.7, the issue does not appear.

Used version:
GNU Fortran (Debian 4.9.1-17) 4.9.1 [~ SVN r216240]

Also
GNU Fortran (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
GNU Fortran (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] 
are affected.


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #28 from Dominique d'Humieres  ---
With the patches in comments 15 and 27 applied on top of r216304, bootstrap
stil fails with

libtool: compile:  /opt/gcc/p_build/./gcc/xgcc -B/opt/gcc/p_build/./gcc/
-B/opt/gcc/gcc4.10p-216304p1/x86_64-apple-darwin14.0.0/bin/
-B/opt/gcc/gcc4.10p-216304p1/x86_64-apple-darwin14.0.0/lib/ -isystem
/opt/gcc/gcc4.10p-216304p1/x86_64-apple-darwin14.0.0/include -isystem
/opt/gcc/gcc4.10p-216304p1/x86_64-apple-darwin14.0.0/sys-include
-DHAVE_CONFIG_H -I. -I../../../../p_work/libquadmath -I
../../../../p_work/libquadmath/../include -g -O2 -m32 -MT math/remainderq.lo
-MD -MP -MF math/.deps/remainderq.Tpo -c
../../../../p_work/libquadmath/math/remainderq.c  -fno-common -DPIC -o
math/.libs/remainderq.o
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//cclKy0QW.s:388:non-relocatable
subtraction expression, "LC1" minus "L1$pb"
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//cclKy0QW.s:388:symbol:
"L1$pb" can't be undefined in a subtraction expression
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//cclKy0QW.s:unknown:Undefined
local symbol L1$pb


[Bug target/63223] [avr] Make jumptables work with -Wl,--section-start,.text=

2014-10-17 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63223

--- Comment #6 from Jorn Wolfgang Rennecke  ---
(In reply to Jorn Wolfgang Rennecke from comment #4)
> However, you now made it all the way use an incorrect order - starting at the
> end and incrementing from there.
Oops, I mean decrementing from there.  But the point still stands.


[Bug c++/63531] gcc segfaults on some sourcefiles when using '-Weffc++' and '-fsanitize=undefined' together

2014-10-17 Thread allizgubccg at reallysoft dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63531

--- Comment #4 from Ralf  ---
(In reply to Marek Polacek from comment #3)
> Actually, I can't reproduce it with 4.9 nor with 5.  I'd say your version
> doesn't have r215459 yet, which I believe is the fix.  Can you try newer GCC?

I've tried it with 4.9.1 release version.. i don't see any newer release. Which
version should i test?


[Bug target/63223] [avr] Make jumptables work with -Wl,--section-start,.text=

2014-10-17 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63223

--- Comment #7 from Jorn Wolfgang Rennecke  ---
(In reply to Jorn Wolfgang Rennecke from comment #5)
> I also observe that the cpi/cpc/brne idiom that is used throughout -
> before and after your patch - is nonsentical.

Oops, I drew conclusions from the "operation" short description of CPC that are
not borne out by the detailed flag setting description.


[Bug middle-end/61529] [5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in check_probability, at basic-block.h:953

2014-10-17 Thread renlin.li at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61529

Renlin Li  changed:

   What|Removed |Added

 CC||renlin.li at arm dot com

--- Comment #5 from Renlin Li  ---
Confirm same problem while compiling glibc using arm toolchain with
-march=armv7-a -O2 configuration.


(In reply to David Binderman from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > Started with r210538.
> 
> I am seeing something similar when compiling glibc
> with trunk 20141001 with only -O2.
> 
> ../iconv/skeleton.c: In function ‘gconv’:
> ../iconv/skeleton.c:792:1: internal compiler error: in check_probability, at
> basic-block.h:959
>  }
>  ^
> 0x10685aa check_probability
> ../../src/trunk/gcc/basic-block.h:959
> 0x10685aa apply_probability
> ../../src/trunk/gcc/basic-block.h:988
> 0x10685aa compute_outgoing_frequencies
> ../../src/trunk/gcc/cfgbuild.c:545
> 0x10685aa find_many_sub_basic_blocks(simple_bitmap_def*)
> ../../src/trunk/gcc/cfgbuild.c:636
> 
> Code ok with 20140927.

[Bug middle-end/61529] [5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in check_probability, at basic-block.h:953

2014-10-17 Thread renlin.li at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61529

--- Comment #6 from Renlin Li  ---
emit_case_nodes calls conditional_probability with a very large first argument. 

After GCOV_COMPUTE_SCALE calculation, the result overflows into a negative
number.

It's recorded into the cmp_and_jump rtx as a note which is later read and
trigger the assertion.


[Bug middle-end/61529] [5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in check_probability, at basic-block.h:953

2014-10-17 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61529

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Target||x86_64*, arm*
 CC||ktkachov at gcc dot gnu.org
  Known to work||4.9.2
  Known to fail||5.0

--- Comment #7 from ktkachov at gcc dot gnu.org ---
Filling out some fields


[Bug bootstrap/63545] ICE building GCC hash_table::find_slot_with_hash

2014-10-17 Thread bill.klees at teamquest dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63545

--- Comment #3 from Bill Klees  ---
Simplified Preprocessed source fails with same error


typedef int TItype __attribute__((mode(TI)));
typedef int DItype __attribute__((mode(DI)));
typedef unsigned int UDItype __attribute__((mode(DI)));

struct DWstruct { DItype high, low; };

typedef union
{
struct DWstruct s;
TItype ll;
} DWunion;

TItype
__multi3(TItype u, TItype v)
{
const DWunion uu = { .ll = u };
const DWunion vv = { .ll = v };
DWunion w = { .ll = ({ DWunion __w; __asm__("xma.hu %0 = %2, %3,
f0\n\txma.l %1 = %2, %3, f0" : "=&f" (__w.s.high)
, "=f" (__w.s.low) : "f" (uu.s.low), "f" (vv.s.low)); __w.ll; }) };

w.s.high += ((UDItype)uu.s.low * (UDItype)vv.s.high
+ (UDItype)uu.s.high * (UDItype)vv.s.low);

return w.ll;
}


[Bug bootstrap/63545] ICE building GCC hash_table::find_slot_with_hash

2014-10-17 Thread bill.klees at teamquest dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63545

--- Comment #4 from Bill Klees  ---
Much simpler test case
--
struct DWstruct { int high, low; };

typedef union
{
struct DWstruct s;
int ll;
} DWunion;

int
__multi3(int u, int v)
{
const DWunion uu = { .ll = u };
return 0;
}


Build Line:
---
/u/scratch/users/b/gcc/hp/gcc491_debug/./gcc/xgcc
-B/u/scratch/users/b/gcc/hp/gcc491_debug/./gcc/
-B/shares/source/itlinks/opt/hpux_ia64/11.2/32/gcc-4.9.1/ia64-hp-hpux11.23/bin/
-mlp64 -g -O2 -o _muldi3.o -c test2.c


Traceback of failure

#0  0x5830880 in  ()
warning: Attempting to unwind past bad PC 0x5830880
#1  0x555be50 in hash_table::find_slot_with_hash (
this=Unhandled dwarf expression opcode
)
#2  0x4501220:0 in _ZL16cselib_find_slotP7rtx_defj13insert_option12machine_mode
(x=Unhandled dwarf expression opcode
)
#3  0x45013a0:0 in cselib_lookup (x=Unhandled dwarf expression opcode
)
#4  0x50aa630:0 in _ZL8use_typeP7rtx_defP14count_use_infoP12machine_mode
(loc=Unhandled dwarf expression opcode
)
#5  0x50aaa70:0 in _ZL8add_usesPP7rtx_defPv (ploc=Unhandled dwarf expression
opcode
)
#6  0x4aeac10:0 in for_each_rtx (x=Unhandled dwarf expression opcode
)
#7  0x50a6070:0 in _ZL10add_uses_1PP7rtx_defPv (x=0x76f8b6f8, cui=0x7fffc680)
#8  0x4ae4bf0:0 in note_uses (pbody=Unhandled dwarf expression opcode
)
#9  0x50abfb0:0 in _ZL13add_with_setsP7rtx_defP10cselib_seti (insn=Unhandled
dwarf expression opcode
)
#10 0x4506080:0 in _ZL18cselib_record_setsP7rtx_def (insn=0x76f8b6e0)
#11 0x450a3d0:0 in cselib_process_insn (insn=Unhandled dwarf expression opcode
)
#12 0x50b8980:0 in _ZL13vt_initializev ()
#13 0x50d6840:0 in variable_tracking_main ()
#14 0x511f1c0:0 in _ZL10ia64_reorgv ()
#15 0x4adbe50:0 in _GLOBAL__N_1::pass_machine_reorg::execute (this=0x49fe960:0)
at /shares/scratch/users/b/gcc/hp/gcc-4.9.1/./gcc/reorg.c:3936
#16 0x49fe960:0 in execute_one_pass (pass=Unhandled dwarf expression opcode
)
#17 0x49ff4a0:0 in execute_pass_list (pass=0x4027c610)
#18 0x49ff500:0 in execute_pass_list (pass=0x4027bd50)
#19 0x49ff500:0 in execute_pass_list (pass=0x4027aed0)
---Type  to continue, or q  to quit---
#20 0x44de270:0 in _ZL15expand_functionP11cgraph_node (node=Unhandled dwarf
expression opcode
)
#21 0x44e3800:0 in compile ()
#22 0x44e4060:0 in finalize_compilation_unit ()
#23 0x4265f90:0 in c_write_global_declarations ()
#24 0x4bb8680:0 in _ZL12compile_filev ()
#25 0x4bbdb30:0 in toplev_main (argc=23, argv=0x75b8)
#26 0x5431a70:0 in main (argc=23, argv=0x75b8)
at /shares/scratch/users/b/gcc/hp/gcc-4.9.1/./gcc/main.c:37


[Bug c++/63578] New: ICE In layout_type, at stor-layout.c:2398

2014-10-17 Thread ppluzhnikov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63578

Bug ID: 63578
   Summary: ICE In  layout_type, at stor-layout.c:2398
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ppluzhnikov at google dot com

Google ref: b/18024040

Test:

int *b;
auto __attribute__ ((may_alias)) a = b;  // replace auto with "int*" to fix

Using trunk @r216408:


r216408/bin/g++ -c -std=c++11 t.ii
t.ii:2:34: internal compiler error: in layout_type, at stor-layout.c:2398
 auto __attribute__ ((may_alias)) a = b;
  ^
0xbef8f3 layout_type(tree_node*)
../../gcc/stor-layout.c:2398
0xe36955 type_hash_canon(unsigned int, tree_node*)
../../gcc/tree.c:6821
0xe5344c build_type_attribute_qual_variant(tree_node*, tree_node*, int)
../../gcc/tree.c:4668
0x7a4966 decl_attributes(tree_node**, tree_node*, int)
../../gcc/attribs.c:621
0x670604 cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/cp/decl2.c:1470
0x5d1162 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/cp/decl.c:4630
0x6b9a2a cp_parser_init_declarator
../../gcc/cp/parser.c:17060
0x6bb559 cp_parser_simple_declaration
../../gcc/cp/parser.c:11538
0x69b0d3 cp_parser_block_declaration
../../gcc/cp/parser.c:11419
0x6c6df9 cp_parser_declaration
../../gcc/cp/parser.c:11316
0x6c5a3a cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:11202
0x6c72e2 cp_parser_translation_unit
../../gcc/cp/parser.c:4090
0x6c72e2 c_parse_file()
../../gcc/cp/parser.c:32207
0x7f1942 c_common_parse_file()
../../gcc/c-family/c-opts.c:1046
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Also broken in gcc-4.8


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #29 from Jeffrey A. Law  ---
I thought we had already dealt with the "hidden" GOT usages that show up during
reload...  Is it IRA that's removing the SET_GOT?


[Bug target/63534] [5 Regression] Bootstrap failure on x86_64/i686-linux

2014-10-17 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534

--- Comment #30 from Iain Sandoe  ---
FWIW, I built a stage #1 with fortran, objc and ada enabled.

libgcc, libstdc++v3, libgomp, libobjc and libada build.

libgfortran & libquadmath fail (errors as per Dominique's post).


[Bug c++/63579] New: New attribute for empty member optimization

2014-10-17 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63579

Bug ID: 63579
   Summary: New attribute for empty member optimization
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: glisse at gcc dot gnu.org

Hello,

I am getting a bit sick of all the artificial base classes invented just so we
can benefit from the empty base optimization when we actually want a member. I
believe an attribute would be a nice way to work around this standard
misfeature:

template 
struct compressed_pair
{
  T1 t1 [[gnu::empty]];
  T2 t2 [[gnu::empty]];
// ... all the member functions
};

struct Empty { };
static_assert (sizeof (compressed_pair) == sizeof (int), "too
long");


To be more specific, I was thinking of having the attribute mean: if the type
is a class type, for layout purposes pretend it is appended at the end of the
list of base classes (it also has an impact on non-empty members). But any
variant would do, as long as it stops being interesting to put a class as a
base instead of a member. The layout code handles bases differently enough that
it doesn't look as easy to implement as I had hoped. I'll attach a hack that I
am playing with.

We will also hit the ABI misfeature that means that in layout_empty_base we
only test offset 0 before jumping to eoc without testing offsets alignment,
2*alignment, etc. But that's another fight...


[Bug c++/63579] New attribute for empty member optimization

2014-10-17 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63579

--- Comment #1 from Marc Glisse  ---
Created attachment 33750
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33750&action=edit
Hack to handle empty members as bases


[Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support

2014-10-17 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513

Oleg Endo  changed:

   What|Removed |Added

  Attachment #33745|0   |1
is obsolete||

--- Comment #37 from Oleg Endo  ---
Created attachment 33751
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33751&action=edit
Use SImode for FPSCR, add __builtin_sh_get_fpscr, __builtin_sh_set_fpscr

I'm now testing this patch.  It removes The PSImode for FPSCR completely and
splits the fpu_switch insn into two separate lds_fpscr and sts_fpscr insns. 
This allows relaxing the insn dependencies.  Also now that sts_fpscr becomes a
single-set insn, it can be stuffed into delay slots.
I've also removed the alternatives for FPSCR <-> memory, except the pre-dec and
post-inc ones, which are needed for push and pop insns.  As a consequence, a
user initiated __builtin_sh_get_fpscr () to a memory will always be ferried
though a general register.  There is some room for improvement, but it goes
into the direction of address-mode-selection optimization, which can be done
later.

When doing a __builtin_sh_set_fpscr (value) the compiler will always insert
code to preserve the current FPSCR FR, SZ, PR mode bits.  This always involves
getting the current FPSCR into a general register first and then loading FPSCR
from a general register.  Thus we can omit FPSCR loads from memory for now.


[Bug libstdc++/57250] [C++11] std::shared_ptr misses atomic_* support

2014-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug c/63549] [4.8/4.9/5] ICE in build_array_ref with invalid code

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63549

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Fri Oct 17 18:42:27 2014
New Revision: 216413

URL: https://gcc.gnu.org/viewcvs?rev=216413&root=gcc&view=rev
Log:
PR c/63549
* c-typeck.c (build_array_ref): Bail if the index in an incomplete
type.

* gcc.dg/pr63549.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr63549.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog


[Bug c/63549] [4.8/4.9/5] ICE in build_array_ref with invalid code

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63549

Marek Polacek  changed:

   What|Removed |Added

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

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


[Bug c/63543] incomplete type error should suppress duplicates

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63543

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Fri Oct 17 18:53:35 2014
New Revision: 216414

URL: https://gcc.gnu.org/viewcvs?rev=216414&root=gcc&view=rev
Log:
PR c/63543
* c-tree.h (C_TYPE_ERROR_REPORTED): Define.
* c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
error multiple times.  Print the type.

* gcc.dg/pr63543.c: New test.
* gcc.dg/array-8.c: Remove dg-error.
* gcc.dg/pr48552-1.c: Remove and adjust dg-error.
* gcc.dg/pr48552-2.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.dg/pr63543.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-tree.h
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/array-8.c
trunk/gcc/testsuite/gcc.dg/pr48552-1.c
trunk/gcc/testsuite/gcc.dg/pr48552-2.c


[Bug c/63543] incomplete type error should suppress duplicates

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63543

Marek Polacek  changed:

   What|Removed |Added

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

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


[Bug ipa/63580] New: [5 Regression] ICE : error: invalid argument to gimple call

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63580

Bug ID: 63580
   Summary: [5 Regression] ICE : error: invalid argument to gimple
call
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
CC: marxin at gcc dot gnu.org

trippels@gcc1-power7 status % cat defaults.ii
struct A
{
};
template  A operator%(L, R);
template 
void make_tuple (A0 &, A1, A2, A3);
A
bar (int p1, char p2, int p3, double p4)
{
  A a;
  make_tuple (p1, p2, p3, p4);
  return "int; char; string; double; " % a;
}
A
foo (int p1, char p2, int p3, double p4)
{
  A b;
  make_tuple (p1, p2, p3, p4);
  return "int; char; string; double; " % b;
}

trippels@gcc1-power7 status % g++ -c -w -O2 -fPIC defaults.ii
defaults.ii: In function ‘A bar(int, char, int, double)’:
defaults.ii:20:1: error: invalid argument to gimple call
 }
 ^
p1
# .MEM_5 = VDEF <.MEM_1(D)>
 = _Z3fooicid.localalias.0 (p1, p2_2(D), p3_3(D), p4_4(D)); [tail call]
defaults.ii:20:1: internal compiler error: verify_gimple failed
0x109d2c2f verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5025
0x10893493 execute_function_todo
../../gcc/gcc/passes.c:1755
0x10894137 do_per_function
../../gcc/gcc/passes.c:1489
0x10894137 do_per_function
../../gcc/gcc/passes.c:1479
0x108942ef execute_todo
../../gcc/gcc/passes.c:1812
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
trippels@gcc1-power7 status % g++ -c -fno-ipa-icf -O2 -fPIC defaults.ii
trippels@gcc1-power7 status %

[Bug ipa/63580] [5 Regression] ICE : error: invalid argument to gimple call

2014-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63580

Markus Trippelsdorf  changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug c++/63531] gcc segfaults on some sourcefiles when using '-Weffc++' and '-fsanitize=undefined' together

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63531

--- Comment #5 from Marek Polacek  ---
(In reply to Ralf from comment #4)
> I've tried it with 4.9.1 release version.. i don't see any newer release.
> Which version should i test?

I meant a GCC build, that contains r215459 fix (for that you'd have to build
gcc, 5 nor 4.9.2 haven't been released yet).

But I'm pretty sure this is already fixed.


[Bug c/63567] Linux kernel build error due to non-static initializers

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Fri Oct 17 21:02:54 2014
New Revision: 216416

URL: https://gcc.gnu.org/viewcvs?rev=216416&root=gcc&view=rev
Log:
PR c/63567
* c-typeck.c (digest_init): Allow initializing objects with static
storage duration with compound literals even in C99 and add pedwarn
for it.

* gcc.dg/pr61096-1.c: Change dg-error into dg-warning.
* gcc.dg/pr63567-1.c: New test.
* gcc.dg/pr63567-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr63567-1.c
trunk/gcc/testsuite/gcc.dg/pr63567-2.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr61096-1.c


[Bug c/63567] Linux kernel build error due to non-static initializers

2014-10-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Should be fixed.  I did what I outlined in #c2 and #c3.


[Bug debug/63581] New: undefined references in debug_info

2014-10-17 Thread xur at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63581

Bug ID: 63581
   Summary: undefined references in debug_info
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xur at google dot com

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

I got the following error when compiling a file with FDO.

/tmp/cc6azLyK.o:(.debug_info+0x228): undefined reference to `.L29'

The error is triggered by function splitting. Adding
-fno-reorder-blocks-and-partition will make the build pass.

Here is the diagnosis: 
We generate a label die and assume the label instruction will be generated in
final pass. This label is marked as deleted, but because it's a user
defined label, we should output it in the final pass. 

This label instruction is removed from insn stream in
record_effective_endpoints() and put the header of one bb and later
merged to the footer of another. The bb footer got overwritten in
emit_barrier_after_bb() (from add_labels_and_missing_jumps()). Since it's
overwritten, it never gets to put back to inst stream in cfg_layout_finalize.

I think the overwritten in emit_barrier_after_bb() is wrong. We should append
to the bb footer if the footer contains non-barrier instruction.

Once I do the appending, the label is emitted.

Reproducer attached. Build instructions are in the head of the file.


[Bug debug/63581] undefined references in debug_info

2014-10-17 Thread xur at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63581

--- Comment #1 from xur at google dot com ---
Patches is here:
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01795.html


[Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support

2014-10-17 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513

--- Comment #38 from Oleg Endo  ---
(In reply to Oleg Endo from comment #37)
> Created attachment 33751 [details]
> Use SImode for FPSCR, add __builtin_sh_get_fpscr, __builtin_sh_set_fpscr
> 
> I'm now testing this patch.

... there are no new failures for -m4 -ml and -m4 -mb.  I'm tempted to apply
it.  Kaz, do you have any objections?


[Bug tree-optimization/63569] [5.0 Regression] Wrong code with volatile and ICF

2014-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63569

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
URL||https://gcc.gnu.org/ml/gcc-
   ||patches/2014-10/msg01723.ht
   ||ml
   Last reconfirmed||2014-10-17
   Assignee|unassigned at gcc dot gnu.org  |mliska at suse dot cz
 Ever confirmed|0   |1


[Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support

2014-10-17 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53513

--- Comment #39 from Kazumoto Kojima  ---
(In reply to Oleg Endo from comment #38)
> ... there are no new failures for -m4 -ml and -m4 -mb.  I'm tempted to apply
> it.  Kaz, do you have any objections?

I have no objection.


[Bug c++/63582] New: [5 Regression]: g++.dg/init/enum1.C ... (test for errors, line 12)

2014-10-17 Thread hp at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63582

Bug ID: 63582
   Summary: [5 Regression]:  g++.dg/init/enum1.C ... (test for
errors, line 12)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hp at gcc dot gnu.org
CC: dj at gcc dot gnu.org
  Host: x86_64-unknown-linux-gnu
Target: cris-axis-elf

This test used to pass and now fails.
Last known previous revision it passed: r216206.
First known revision where FAIL is seen: r216224.

A commit in the revision range (216206:216224] caused this test to fail as
follows:
FAIL: g++.dg/init/enum1.C  -std=gnu++98  (test for errors, line 12)
FAIL: g++.dg/init/enum1.C  -std=gnu++11  (test for errors, line 12)
FAIL: g++.dg/init/enum1.C  -std=gnu++1y  (test for errors, line 12)

The g++.log has nothing to add; there's simply no error for the enum, which
seems like a gcc bug rather than a required test-suite tweak.

In gcc-testresults@, I see similar errors for arm7l-unknown-linux-gnueabihf and
hppa2.0w-hp-hpux11.11.  Not sure of the other systems, but there's no
target-specific support for __int128 for cris-elf.

Author of suspected commit in revision-range CC:ed.


[Bug tree-optimization/63583] New: ICF does not check that the template strings are the same

2014-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63583

Bug ID: 63583
   Summary: ICF does not check that the template strings are the
same
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org

Take:
static int f(int t) __attribute__((noinline));

static int g(int t) __attribute__((noinline));
static int g(int t)
{
  asm("addl %0, 1": "+r"(t));  
  return t;
}
static int f(int t)
{
  asm("addq %0, -1": "+r"(t));
  return t;
}


int h(int t)
{
  return f(t) + g(t);
}

--- CUT ---
ICF decides both g and f are the same function but they are not due to the
different strings in the inline-asm.


[Bug tree-optimization/63583] [5 Regression] ICF does not check that the template strings are the same

2014-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63583

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |5.0
Summary|ICF does not check that the |[5 Regression] ICF does not
   |template strings are the|check that the template
   |same|strings are the same

--- Comment #1 from Andrew Pinski  ---
Note I found this while running/building uboot for Octeon (a MIPS64 processor).


[Bug c++/63528] A variadic variable template cannot use the ::value of a variadic trait

2014-10-17 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63528

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #3 from Jason Merrill  ---
Fixed.


[Bug c++/63584] New: ICE in strip_typedefs, at cp/tree.c:1326

2014-10-17 Thread jaredhoberock at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63584

Bug ID: 63584
   Summary: ICE in strip_typedefs, at cp/tree.c:1326
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jaredhoberock at gmail dot com

The attached preprocessed source produces the following compiler error message:


$ g++ -std=c++11 -pthread preprocessed_repro.cpp 
‘
In file included from test_nested_executor.cpp:3:0:
in strip_typedefs, at cp/tree.c:1326
 auto inner_lambda = inner_lambda_gcc49_workaround{outer_idx, outer_shared_ref};
   
   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Preprocessed source stored into /tmp/ccSYvoB9.out file, please attach this to
your bugreport.



I believe this is a regression because g++4.8.2-19ubuntu1 compiles the same
code which executes as expected.

System details:

$ g++ --version ; echo ; uname -a ; echo ; cat /etc/lsb-release 
g++ (Ubuntu 4.9.1-3ubuntu2~14.04.1) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Linux jhoberock-dt-fixme 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

[Bug c++/63584] ICE in strip_typedefs, at cp/tree.c:1326

2014-10-17 Thread jaredhoberock at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63584

--- Comment #1 from jaredhoberock at gmail dot com ---
Created attachment 33753
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33753&action=edit
preprocessed output of ICE reproducer


[Bug c/63567] Linux kernel build error due to non-static initializers

2014-10-17 Thread sasha.levin at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567

Sasha Levin  changed:

   What|Removed |Added

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

--- Comment #6 from Sasha Levin  ---
I'm still seeing the issue with the fix applied:

  CC  kernel/smpboot.o
In file included from include/linux/mutex.h:15:0,
 from include/linux/kernfs.h:13,
 from include/linux/sysfs.h:15,
 from include/linux/kobject.h:21,
 from include/linux/device.h:17,
 from include/linux/node.h:17,
 from include/linux/cpu.h:16,
 from kernel/smpboot.c:4:
include/linux/spinlock_types.h:82:2: error: initializer element is not constant
  (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
  ^
include/linux/mutex.h:112:18: note: in expansion of macro
‘__SPIN_LOCK_UNLOCKED’
   , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
  ^
include/linux/mutex.h:118:27: note: in expansion of macro ‘__MUTEX_INITIALIZER’
  struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
   ^
kernel/smpboot.c:80:8: note: in expansion of macro ‘DEFINE_MUTEX’
 static DEFINE_MUTEX(smpboot_threads_lock);
^
include/linux/spinlock_types.h:82:2: note: (near initialization for
‘smpboot_threads_lock.wait_lock’)
  (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
  ^
include/linux/mutex.h:112:18: note: in expansion of macro
‘__SPIN_LOCK_UNLOCKED’
   , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
  ^
include/linux/mutex.h:118:27: note: in expansion of macro ‘__MUTEX_INITIALIZER’
  struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
   ^
kernel/smpboot.c:80:8: note: in expansion of macro ‘DEFINE_MUTEX’
 static DEFINE_MUTEX(smpboot_threads_lock);