[Bug target/66867] Suboptimal code generation for atomic_compare_exchange

2015-09-21 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66867

Alan Modra  changed:

   What|Removed |Added

 Target||powerpc64*-*-*, x86_64-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 CC||amodra at gmail dot com
Summary|Suboptimal code generation  |Suboptimal code generation
   |for C11 |for atomic_compare_exchange
   |atomic_compare_exchange_str |
   |ong_explicit()  |
 Ever confirmed|0   |1

--- Comment #2 from Alan Modra  ---
Confirmed.  Here's another related testcase showing unnecessary stack memory
writes and reads on both powerpc64le and x86_64.

int test2 (int *ptr, int value, int comparand)
{
  __atomic_compare_exchange_n (ptr, &comparand, value,
   false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
  return comparand;
}


[Bug target/66609] [sh] Relative address expressions bind at as-time, even if symbol is weak

2015-09-21 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66609

--- Comment #7 from Rich Felker  ---
Created attachment 36359
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36359&action=edit
preprocessed source still affected by the bug

Oddly I'm still experiencing this bug for some functions but not others, even
with the patch applied. I've attached preprocessed output of a file which is
being miscompiled: the reference to __do_cleanup_push wrongly binds locally,
but the reference to __do_cleanup_pop is overridable like it should be.


[Bug middle-end/67639] ICE at -O1 and above on x86_64-linux-gnu in expand_gimple_basic_block, at cfgexpand.c:5697

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67639

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.  We shouldn't even get to expanding a BB if there were errors.

Of course the issue is (again - dup?) that the "invalid register name" error
is emitted during expansion rather than during parsing.


[Bug target/66609] [sh] Relative address expressions bind at as-time, even if symbol is weak

2015-09-21 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66609

--- Comment #8 from Rich Felker  ---
Perhaps hold off on worrying about this; it's only happening with -mfdpic (with
my forward-port of the fdpic patch applied) so it's possible that the bug is on
my end in code that's not in upstream gcc. I'll follow up on this more later.


[Bug target/67636] [6 Regression][SH] gcc.target/sh/pr54236-1.c failures

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67636

Richard Biener  changed:

   What|Removed |Added

Version|unknown |6.0
   Target Milestone|--- |6.0


[Bug libstdc++/67647] [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67647

Richard Biener  changed:

   What|Removed |Added

   Keywords||build
  Component|bootstrap   |libstdc++
   Target Milestone|--- |6.0


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #1 from Richard Biener  ---
You are using -O3 -march=native it seems.  Note that the error doesn't make
much sense to me.


[Bug c++/67650] undef reference with -fdevirtualize

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67650

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #7 from Richard Biener  ---
Honza - can you please look at the few devirt issues we still have on trunk and
the gcc 5 branch?


[Bug target/67474] [6 regression] tree-vect-loop.c:2759:1: error: insn does not satisfy its constraints breaks ARM bootstrap

2015-09-21 Thread mikpelinux at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67474

--- Comment #1 from Mikael Pettersson  ---
Still occurs with gcc-6-20150920.


[Bug middle-end/67662] -fsanitize=undefined cries wolf for X - 1 + X when X is 2**30

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67662

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #2 from Richard Biener  ---
  /* With undefined overflow we can only associate constants with one
 variable, and constants whose association doesn't overflow.  */
  if ((POINTER_TYPE_P (atype) && POINTER_TYPE_OVERFLOW_UNDEFINED)
  || (INTEGRAL_TYPE_P (atype) && !TYPE_OVERFLOW_WRAPS (atype)))
{
...
  /* The only case we can still associate with two variables
 is if they are the same, modulo negation and bit-pattern
 preserving conversions.  */
  if (!operand_equal_p (tmp0, tmp1, 0))
ok = false;

but that's only if they cancel out.  I think the above code is mine, thus,
mine.


[Bug middle-end/67651] Optimizer assumes nothing can reside at address 0 despite -fno-delete-null-pointer-checks

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67651

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-09-21
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
We optimize this since GCC 3.4 and -fno-delete-null-pointer-checks already
doesn't have any effect on that.  GCC 3.3 wasn't able to optimize this with
any setting of this flag.

@item -fdelete-null-pointer-checks
@opindex fdelete-null-pointer-checks
Assume that programs cannot safely dereference null pointers, and that
no code or data element resides at address zero.
This option enables simple constant
folding optimizations at all optimization levels.  In addition, other
optimization passes in GCC use this flag to control global dataflow
analyses that eliminate useless checks for null pointers; these assume
that a memory access to address zero always results in a trap, so
that if a pointer is checked after it has already been dereferenced,
it cannot be null.

Note however that in some environments this assumption is not true.
Use @option{-fno-delete-null-pointer-checks} to disable this optimization
for programs that depend on that behavior.

This option is enabled by default on most targets.  On Nios II ELF, it
defaults to off.  On AVR and CR16, this option is completely disabled.


so confirmed.  Note that GIMPLE optimizers are fine and we end up expanding
from

main ()
{
  int _1;

  :
  if (&_vector_table == 0B)
goto ;
  else
goto ;

  :

  :
  # _1 = PHI <1(2), 2(3)>
  return _1;

But RTL generation already fucks this up:

;; Generating RTL for gimple basic block 2

;; if (&_vector_table == 0B)

(nil)

...

;;
;; Full RTL generated for this function:
;;
(note 1 0 5 NOTE_INSN_DELETED)
;; basic block 2, loop depth 0, count 0, freq 1, maybe hot
;;  prev block 0, next block 1, flags: (NEW, REACHABLE, RTL, MODIFIED)
;;  pred:   ENTRY [100.0%]  (FALLTHRU)
(note 5 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note 2 5 4 2 NOTE_INSN_FUNCTION_BEG)
(insn 4 2 10 2 (set (reg:SI 87 [ D.1844 ])
(const_int 2 [0x2])) t.c:10 -1
 (nil))
(insn 10 4 14 2 (set (reg:SI 88 [  ])
(reg:SI 87 [ D.1844 ])) -1
 (nil))
(insn 14 10 15 2 (set (reg/i:SI 0 ax)
(reg:SI 88 [  ])) t.c:12 -1
 (nil))
(insn 15 14 0 2 (use (reg/i:SI 0 ax)) t.c:12 -1
 (nil))
;;  succ:   EXIT [100.0%]  (FALLTHRU)


Because of

simplify_const_relational_operation (code=EQ, mode=DImode, op0=0x76a06168, 
op1=0x768d3480)
at /space/rguenther/src/svn/trunk/gcc/simplify-rtx.c:4840
5088  /* Some addresses are known to be nonzero.  We don't know
5089 their sign, but equality comparisons are known.  */
5090  if (nonzero_address_p (trueop0))
5091{
5092  if (code == EQ || code == LEU)
5093return const0_rtx;

on (symbol_ref:DI ("_vector_table") [flags 0x40] )

/* Return true if X is an address that is known to not be zero.  */

bool
nonzero_address_p (const_rtx x)
{
  const enum rtx_code code = GET_CODE (x);

  switch (code)
{
case SYMBOL_REF:
  return !SYMBOL_REF_WEAK (x);

which misses a check on flag_delete_null_pointer_checks.  Fixing that fixes the
bug.


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

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29842
Bug 29842 depends on bug 28791, which changed state.

Bug 28791 Summary: sh64-elf -mdiv= options bitrot
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28791

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX


[Bug libobjc/24714] objc/execute/bf-10.m and others fail on sh64-elf

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24714

Oleg Endo  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||olegendo at gcc dot gnu.org
 Resolution|--- |WONTFIX

--- Comment #2 from Oleg Endo  ---
SH5/SH64 has been declared obsolete
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01516.html


[Bug target/28791] sh64-elf -mdiv= options bitrot

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28791

Oleg Endo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||olegendo at gcc dot gnu.org
 Resolution|--- |WONTFIX

--- Comment #1 from Oleg Endo  ---
SH5/SH64 has been declared obsolete
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01516.html


[Bug target/58866] sh64: Wrong genmultilib invocation

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58866

Oleg Endo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #1 from Oleg Endo  ---
SH5/SH64 has been declared obsolete
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01516.html


[Bug rtl-optimization/20211] autoincrement generation is poor

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20211

Oleg Endo  changed:

   What|Removed |Added

 Target||sh*-*-*
 CC||olegendo at gcc dot gnu.org

--- Comment #40 from Oleg Endo  ---
Just hit this PR by accident.  I wonder how many address mode related PRs are
hanging around there...

I hope that the AMS pass will help.  The current branch is
https://github.com/erikvarga/gcc


[Bug c++/67663] New: ambiguous namespace/class name not reported as error

2015-09-21 Thread andreim77 at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

Bug ID: 67663
   Summary: ambiguous namespace/class name not reported as error
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andreim77 at yahoo dot com
  Target Milestone: ---

#include 

struct a {
static const int i=0;
};

namespace x {
namespace a {
int i;
}
}

using namespace x;

int main()
{
a::i=1;
std::cout << "i = " << a::i;
return 0;
}

no error with GCC

clang report:
main.cpp:17:5: error: 'a' is not a class, namespace, or enumeration
a::i=1;
^
main.cpp:17:5: error: reference to 'a' is ambiguous
a::i=1;
^
main.cpp:3:8: note: candidate found by name lookup is 'a'
struct a {
   ^
main.cpp:8:15: note: candidate found by name lookup is 'x::a'
namespace a {
  ^
main.cpp:18:28: error: 'a' is not a class, namespace, or enumeration
std::cout << "i = " << a::i;
   ^
main.cpp:18:28: error: reference to 'a' is ambiguous
std::cout << "i = " << a::i;
   ^
main.cpp:3:8: note: candidate found by name lookup is 'a'
struct a {
   ^
main.cpp:8:15: note: candidate found by name lookup is 'x::a'
namespace a {
  ^
main.cpp:20:2: error: no newline at end of file [-Werror,-Wnewline-eof]
}
 ^
5 errors generated.


[Bug target/37633] [4.9/5/6 Regression] wrong register use on sh64

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633

Oleg Endo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||olegendo at gcc dot gnu.org
 Resolution|--- |WONTFIX

--- Comment #17 from Oleg Endo  ---
SH5/SH64 has been declared obsolete
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01516.html


[Bug target/67660] [SH] Automatically insert atomic rewind code into ISR prologue

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67660

--- Comment #1 from Oleg Endo  ---
Just a note ...
It might also make sense to tell the compiler (via function attribute) whether
the ISR is re-entrant or not.  On a single-core system, atomic ops in an ISR
can be converted into normal load-modify-store ops if the ISR context can't be
interrupted.


[Bug c++/67663] ambiguous namespace/class name not reported as error

2015-09-21 Thread andreim77 at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

--- Comment #1 from Andrei M.  ---
in line:

a::i=1;

i is resolved to x::a::i


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #2 from David Binderman  ---
(In reply to Richard Biener from comment #1)
> You are using -O3 -march=native it seems.  

I checked, and the problem also occurs in the simpler case
when -O3 -march=native is replaced by -O2.

> Note that the error doesn't make much sense to me.

bitmap.h:332 is

  head->first = head->current = NULL;

bitmap.c:286 is

  bitmap_initialize_stat (map, bit_obstack PASS_MEM_STAT);

tree-into-ssa.c:489 is

 db_p->def_blocks = BITMAP_ALLOC (&update_ssa_obstack);


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #8 from Oleg Endo  ---
BTW, I'd recommend not specifying -ffloat-store on SH.  It doesn't affect FP
precision (unlike on x86) and just creates slower code.


[Bug c++/39057] ICE with default argument in friend declaration

2015-09-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39057

Paolo Carlini  changed:

   What|Removed |Added

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

--- Comment #3 from Paolo Carlini  ---
Not actively working on it.


[Bug debug/67664] New: [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

Bug ID: 67664
   Summary: [6 Regression] Duplicate AT_const_value attributes in
some c++ cases.
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

[AFAICT] between 227779 and 227800 a change was introduced that causes multiple
instances of AT_const_value to be inserted in some DIEs.

This is picked up by Darwin's dsymutil and results in wide-spread fails in the
libstdc++ test suite for both m32 and m64.

The duplicate is not detected by binutils ld, but appears to be present on a
current build of x86_64-linux-gnu.

testcase libstdc++/17_intro/freestanding.cc:

linux (r227958):
 <2><398>: Abbrev Number: 25 (DW_TAG_structure_type)
<399>   DW_AT_name: (indirect string, offset: 0x7be):
numeric_limits
<39d>   DW_AT_byte_size   : 1
<39e>   DW_AT_decl_file   : 8
<39f>   DW_AT_decl_line   : 1132
<3a1>   DW_AT_sibling : <0x578>
 <3><3a5>: Abbrev Number: 26 (DW_TAG_member)
<3a6>   DW_AT_name: (indirect string, offset: 0x75f):
is_specialized
<3aa>   DW_AT_decl_file   : 8
<3ab>   DW_AT_decl_line   : 1134
<3ad>   DW_AT_type: <0xc81>
<3b1>   DW_AT_external: 1
<3b1>   DW_AT_declaration : 1
<3b1>   DW_AT_const_value : 1
<3b2>   DW_AT_const_value : 1
 <3><3b3>: Abbrev Number: 26 (DW_TAG_member)
<3b4>   DW_AT_name: (indirect string, offset: 0x503): digits
<3b8>   DW_AT_decl_file   : 8
<3b9>   DW_AT_decl_line   : 1147
<3bb>   DW_AT_type: <0x8dd>
<3bf>   DW_AT_external: 1
<3bf>   DW_AT_declaration : 1
<3bf>   DW_AT_const_value : 63
<3c0>   DW_AT_const_value : 63
 <3><3c1>: Abbrev Number: 26 (DW_TAG_member)

==

Darwin (r227952):
0x03ff: TAG_structure_type [14] *
 AT_name( "numeric_limits" )
 AT_byte_size( 0x01 )
 AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
 AT_decl_line( 1132 )
 AT_sibling( {0x0835} )

0x0421: TAG_member [15]  
 AT_name( "is_specialized" )
 AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
 AT_decl_line( 1134 )
 AT_type( {0x03c8} ( const bool ) )
 AT_external( 0x01 )
 AT_declaration( 0x01 )
 AT_const_value( 0x01 )
 AT_const_value( 0x01 )

0x043c: TAG_member [15]  
 AT_name( "digits" )
 AT_decl_file(
"/Volumes/Data0/gcc-trunk/libstdc++-v3/include/std/limits" )
 AT_decl_line( 1147 )
 AT_type( {0x03cd} ( const int ) )
 AT_external( 0x01 )
 AT_declaration( 0x01 )
 AT_const_value( 0x1f )
 AT_const_value( 0x1f )


[Bug debug/67665] New: ICE when passing two empty files directly to cc1 with -g

2015-09-21 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67665

Bug ID: 67665
   Summary: ICE when passing two empty files directly to cc1 with
-g
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jgreenhalgh at gcc dot gnu.org
  Target Milestone: ---

I typoed inputs to a script, and ended up passing the same empty file twice to
cc1, that gave me an ICE with many recent versions of trunk (at least the last
month). There is no issue when doing the same through the driver, so this
really is a bit of an edge case...

To reproduce:

  touch foo.c
  .../build-gcc/gcc/cc1 foo.c foo.c -g

foo.c:1:0: internal compiler error: in
dwarf2out_register_main_translation_unit, at dwarf2out.c:22590
0x79a24e dwarf2out_register_main_translation_unit
.../gcc-src/gcc/dwarf2out.c:22589
0x5ca751 pop_scope()
.../gcc-src/gcc/c/c-decl.c:1193
0x5cad1f pop_file_scope()
.../gcc-src/gcc/c/c-decl.c:1438
0x682ab7 c_common_parse_file()
.../gcc-src/gcc/c-family/c-opts.c:1059
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


[Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-09-21
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
I'll have a look.


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Markus Trippelsdorf  ---
Also happens on ppc64le:

...
==72250== Invalid write of size 8
==72250==at 0x10200988: bitmap_initialize_stat (bitmap.h:333)
==72250==by 0x10200988: bitmap_obstack_alloc_stat(bitmap_obstack*)
(bitmap.c:286)
==72250==by 0x102A4E03: df_analyze() (df-core.c:1263)
==72250==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==72250==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==72250==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==72250==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==72250==by 0x1027F6CB: cgraph_node::expand() (cgraphunit.c:1983)
==72250==by 0x10281097: expand_all_functions (cgraphunit.c:2119)
==72250==by 0x10281097: symbol_table::compile() (cgraphunit.c:2472)
==72250==by 0x10282D0B: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2562)
==72250==by 0x1063E78F: compile_file() (toplev.c:508)
==72250==by 0x1011535F: do_compile (toplev.c:1973)
==72250==by 0x1011535F: toplev::main(int, char**) (toplev.c:2080)
==72250==by 0x10117337: main (main.c:39)
==72250==  Address 0xe3bdb60 is 256 bytes inside a block of size 65,536 alloc'd
==72250==at 0x4093D9C: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==72250==by 0x10D2562B: xmalloc (xmalloc.c:147)
==72250==by 0x10CC4FC3: mempool_obstack_chunk_alloc(unsigned long)
(memory-block.cc:51)
==72250==by 0x466D2A3: _obstack_begin (in /usr/lib64/libc-2.20.so)
==72250==by 0x107FF9BF: init_alias_vars() (tree-ssa-structalias.c:6658)
==72250==by 0x10800117: compute_points_to_sets
(tree-ssa-structalias.c:6782)
==72250==by 0x10800117: compute_may_aliases() (tree-ssa-structalias.c:7139)
==72250==by 0x1055931B: execute_function_todo(function*, void*)
(passes.c:1932)
==72250==by 0x1055A363: do_per_function(void (*)(function*, void*), void*)
(passes.c:1652)
==72250==by 0x1055A59F: execute_todo(unsigned int) (passes.c:2018)
==72250==by 0x1055D4F7: execute_one_pass(opt_pass*) (passes.c:2345)
==72250==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==72250==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==72250==
==72250== Invalid write of size 8
==72250==at 0x10200998: bitmap_initialize_stat (bitmap.h:332)
==72250==by 0x10200998: bitmap_obstack_alloc_stat(bitmap_obstack*)
(bitmap.c:286)
==72250==by 0x102A4E03: df_analyze() (df-core.c:1263)
==72250==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==72250==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==72250==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==72250==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==72250==by 0x1027F6CB: cgraph_node::expand() (cgraphunit.c:1983)
==72250==by 0x10281097: expand_all_functions (cgraphunit.c:2119)
==72250==by 0x10281097: symbol_table::compile() (cgraphunit.c:2472)
==72250==by 0x10282D0B: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2562)
==72250==by 0x1063E78F: compile_file() (toplev.c:508)
==72250==by 0x1011535F: do_compile (toplev.c:1973)
==72250==by 0x1011535F: toplev::main(int, char**) (toplev.c:2080)
==72250==by 0x10117337: main (main.c:39)
==72250==  Address 0xe3bdb58 is 248 bytes inside a block of size 65,536 alloc'd
==72250==at 0x4093D9C: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==72250==by 0x10D2562B: xmalloc (xmalloc.c:147)
==72250==by 0x10CC4FC3: mempool_obstack_chunk_alloc(unsigned long)
(memory-block.cc:51)
==72250==by 0x466D2A3: _obstack_begin (in /usr/lib64/libc-2.20.so)
==72250==by 0x107FF9BF: init_alias_vars() (tree-ssa-structalias.c:6658)
==72250==by 0x10800117: compute_points_to_sets
(tree-ssa-structalias.c:6782)
==72250==by 0x10800117: compute_may_aliases() (tree-ssa-structalias.c:7139)
==72250==by 0x1055931B: execute_function_todo(function*, void*)
(passes.c:1932)
==72250==by 0x1055A363: do_per_function(void (*)(function*, void*), void*)
(passes.c:1652)
==72250==by 0x1055A59F: execute_todo(unsigned int) (passes.c:2018)
==72250==by 0x1055D4F7: execute_one_pass(opt_pass*) (passes.c:2345)
==72250==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==72250==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==72250==
==72250== Invalid read of size 8
==72250==at 0x10203BE0: bitmap_find_bit (bitmap.c:488)

[Bug libstdc++/67647] [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67647

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-09-21
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1


[Bug middle-end/67653] ICE on valid code on x86_64-linux-gnu: verify_gimple failed

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67653

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed, but I think it's an old regression, started somewhen between r140425
and r140449.


[Bug middle-end/67653] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: verify_gimple failed

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67653

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |4.9.4
Summary|ICE on valid code on|[4.9/5/6 Regression] ICE on
   |x86_64-linux-gnu:   |valid code on
   |verify_gimple failed|x86_64-linux-gnu:
   ||verify_gimple failed


[Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

--- Comment #2 from Richard Biener  ---
Reduced testcase:

struct T
{
  static const int a = 0;
};

int main()
{
  T t;
  return t.a;
}


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #4 from Markus Trippelsdorf  ---
==122519== Invalid write of size 4
==122519==at 0x107D4EF0: vn_nary_op_insert_into(vn_nary_op_s*,
hash_table*, bool) (tree-ssa-sccvn.c:2634)
==122519==by 0x107D528B: sccvn_dom_walker::record_cond(basic_block_def*,
tree_code, tree_node*, tree_node*, bool) (tree-ssa-sccvn.c:4408)
==122519==by 0x107D55EB: sccvn_dom_walker::record_conds(basic_block_def*,
tree_code, tree_node*, tree_node*, bool) (tree-ssa-sccvn.c:4448)
==122519==by 0x107DC503:
sccvn_dom_walker::before_dom_children(basic_block_def*) (tree-ssa-sccvn.c:4550)
==122519==by 0x10BC99EB: dom_walker::walk(basic_block_def*) (domwalk.c:177)
==122519==by 0x107DE01F: run_scc_vn(vn_lookup_kind) (tree-ssa-sccvn.c:4680)
==122519==by 0x107AAD47: (anonymous
namespace)::pass_fre::execute(function*) (tree-ssa-pre.c:4959)
==122519==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==122519==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==122519==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==122519==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==122519==by 0x1055BA6F: do_per_function_toporder(void (*)(function*,
void*), void*) (passes.c:1729)
==122519==  Address 0xe2be758 is 1,368 bytes inside a block of size 65,536
alloc'd
==122519==at 0x4093D9C: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==122519==by 0x10D2562B: xmalloc (xmalloc.c:147)
==122519==by 0x10299047: allocate (memory-block.h:56)
==122519==by 0x10299047: base_pool_allocator::allocate()
(alloc-pool.h:366)
==122519==by 0x1033686F: allocate (alloc-pool.h:489)
==122519==by 0x1033686F: et_new_tree (et-forest.c:464)
==122519==by 0x102C2C07: calculate_dominance_info(cdi_direction)
(dominance.c:651)
==122519==by 0x106C9EBB: (anonymous
namespace)::pass_build_ssa::execute(function*) (tree-into-ssa.c:2379)
==122519==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==122519==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==122519==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==122519==by 0x1055BA6F: do_per_function_toporder(void (*)(function*,
void*), void*) (passes.c:1729)
==122519==by 0x1055E3AB: execute_ipa_pass_list(opt_pass*) (passes.c:2739)
==122519==by 0x10280E07: ipa_passes (cgraphunit.c:2259)
==122519==by 0x10280E07: symbol_table::compile() (cgraphunit.c:2400)
==122519==
==122519== Invalid read of size 4
==122519==at 0x107D4EA4: vn_nary_op_insert_into(vn_nary_op_s*,
hash_table*, bool) (tree-ssa-sccvn.c:2636)
==122519==by 0x107D528B: sccvn_dom_walker::record_cond(basic_block_def*,
tree_code, tree_node*, tree_node*, bool) (tree-ssa-sccvn.c:4408)
==122519==by 0x107D55EB: sccvn_dom_walker::record_conds(basic_block_def*,
tree_code, tree_node*, tree_node*, bool) (tree-ssa-sccvn.c:4448)
==122519==by 0x107DC503:
sccvn_dom_walker::before_dom_children(basic_block_def*) (tree-ssa-sccvn.c:4550)
==122519==by 0x10BC99EB: dom_walker::walk(basic_block_def*) (domwalk.c:177)
==122519==by 0x107DE01F: run_scc_vn(vn_lookup_kind) (tree-ssa-sccvn.c:4680)
==122519==by 0x107AAD47: (anonymous
namespace)::pass_fre::execute(function*) (tree-ssa-pre.c:4959)
==122519==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==122519==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==122519==by 0x1055D99B: execute_pass_list_1(opt_pass*) (passes.c:2386)
==122519==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==122519==by 0x1055BA6F: do_per_function_toporder(void (*)(function*,
void*), void*) (passes.c:1729)
==122519==  Address 0xe2be758 is 1,368 bytes inside a block of size 65,536
alloc'd
==122519==at 0x4093D9C: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==122519==by 0x10D2562B: xmalloc (xmalloc.c:147)
==122519==by 0x10299047: allocate (memory-block.h:56)
==122519==by 0x10299047: base_pool_allocator::allocate()
(alloc-pool.h:366)
==122519==by 0x1033686F: allocate (alloc-pool.h:489)
==122519==by 0x1033686F: et_new_tree (et-forest.c:464)
==122519==by 0x102C2C07: calculate_dominance_info(cdi_direction)
(dominance.c:651)
==122519==by 0x106C9EBB: (anonymous
namespace)::pass_build_ssa::execute(function*) (tree-into-ssa.c:2379)
==122519==by 0x1055D46F: execute_one_pass(opt_pass*) (passes.c:2332)
==122519==by 0x1055D983: execute_pass_list_1(opt_pass*) (passes.c:2385)
==122519==by 0x1055DA23: execute_pass_list(function*, opt_pass*)
(passes.c:2396)
==122519==by 0x1055BA6F: do_per_function_toporder(void (*)(function*,
void*), void*) (passes.c:1729)
==122519==by 0x1055E3AB: execute_ipa_pass_list(opt_pass*) (passes.c:2739)
==122519==by 0x10280E07: ipa_passes (cgraphunit.c:2259)
==122519==by 0x10280E07: symbol_table::compile() (cgraphunit.

[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

Markus Trippelsdorf  changed:

   What|Removed |Added

 Target|x86_64-pc-linux-gnu |
 CC||miyuki at gcc dot gnu.org

--- Comment #5 from Markus Trippelsdorf  ---
I suspect r227817. Mikhail?


[Bug libgomp/67141] wrong libgomp mutex initialisation order

2015-09-21 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67141

Thomas Schwinge  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|tschwinge at gcc dot gnu.org   |cltang at gcc dot 
gnu.org

--- Comment #5 from Thomas Schwinge  ---
.


[Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

--- Comment #3 from Richard Biener  ---
First time via

#0  add_AT_unsigned (
die=>, attr_kind=DW_AT_const_value, unsigned_val=0)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:3879
#1  0x00bc777f in add_const_value_attribute (
die=>, rtl=0x768d3480)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:15578
#2  0x00bca519 in tree_add_const_value_attribute (
die=>, t=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16386
#3  0x00bca710 in tree_add_const_value_attribute_for_decl (
var_die=>, decl=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16434
#4  0x00bd24f4 in gen_variable_die (decl=, 
origin=, 
context_die=>)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19666
#5  0x00bd8183 in gen_decl_die (decl=, 
origin=, 
context_die=>)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21531
#6  0x00bd44f2 in gen_member_die (type=, 
context_die=>)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20378
#7  0x00bd4d57 in gen_struct_or_union_type_die (
type=, 
context_die=, 
usage=DINFO_USAGE_DIR_USE)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20483
#8  0x00bd5742 in gen_tagged_type_die (
type=, 
context_die=, 
usage=DINFO_USAGE_DIR_USE)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20684
#9  0x00bd5ec1 in gen_type_die_with_usage (
type=, 
context_die=, 
usage=DINFO_USAGE_DIR_USE)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20846
#10 0x00bd622d in gen_type_die (type=, 
context_die=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20901
#11 0x00bd7ff7 in gen_decl_die (decl=, 
origin=, 
context_die=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21487
#12 0x00bd90ed in dwarf2out_decl (decl=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21943
#13 0x00bd85af in dwarf2out_type_decl (
decl=, local=0)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21653
#14 0x00ebc3bc in rest_of_type_compilation (
type=, toplev=1)
at /space/rguenther/src/svn/trunk/gcc/passes.c:349
#15 0x00857e3c in finish_struct_1 (t=)
at /space/rguenther/src/svn/trunk/gcc/cp/class.c:6744

2nd time via

#0  add_AT_unsigned (
die=>, attr_kind=DW_AT_const_value, unsigned_val=0)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:3879
#1  0x00bc777f in add_const_value_attribute (
die=>, rtl=0x768d3480)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:15578
#2  0x00bc95a0 in add_location_or_const_value_attribute (
die=>, decl=, cache_p=false, 
attr=DW_AT_location)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16162
#3  0x00bd8580 in dwarf2out_late_global_decl (
decl=)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21641
#4  0x00b44f10 in analyze_functions (first_time=true)
at /space/rguenther/src/svn/trunk/gcc/cgraphunit.c:1202
#5  0x00b48e55 in symbol_table::finalize_compilation_unit (
this=0x768d00a8)
at /space/rguenther/src/svn/trunk/gcc/cgraphunit.c:2540


[Bug tree-optimization/67470] [5 Regression] ICE at -O3 on x86_64-linux-gnu in compute_live_loop_exits, at tree-ssa-loop-manip.c:235

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67470

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||5.2.0

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


[Bug ipa/66793] [5 Regression] ICE at -Os and above on x86_64-linux-gnu (verify_flow_info failed)

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66793

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug tree-optimization/67121] [5 Regression] wrong code at -O3 on x86_64-linux-gnu

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67121

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug tree-optimization/66952] [6 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66952

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug tree-optimization/67470] [5 Regression] ICE at -O3 on x86_64-linux-gnu in compute_live_loop_exits, at tree-ssa-loop-manip.c:235

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67470

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug ipa/66793] [5 Regression] ICE at -Os and above on x86_64-linux-gnu (verify_flow_info failed)

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66793

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||5.2.0

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


[Bug tree-optimization/66952] [6 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66952

Richard Biener  changed:

   What|Removed |Added

  Known to work||6.0

--- Comment #9 from Richard Biener  ---
Also backported now.


[Bug tree-optimization/67055] [5 Regression] Segmentation fault in fold_builtin_alloca_with_align in tree-ssa-ccp.c

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67055

--- Comment #15 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug middle-end/67271] [5 Regression] ICE with -O1,2,3 on darwin14.5 x86_64

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67271

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 09:55:57 2015
New Revision: 227961

URL: https://gcc.gnu.org/viewcvs?rev=227961&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

Backport from mainline
2015-07-08  Richard Biener  

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c
(insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

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

2015-08-05  Richard Biener  

PR tree-optimization/67055
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Handle
NULL gimple_block.

* g++.dg/torture/pr67055.C: New testcase.

2015-08-05  Richard Biener  

PR tree-optimization/67121
* tree-if-conv.c (combine_blocks): Clear range-info produced
by stmts no longer executed conditionally.

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

2015-09-16  Richard Biener  

PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.

* gcc.dg/pr67271.c: New testcase.

2015-07-22  Richard Biener  

PR tree-optimization/66952
* tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For
blocks we end up executing unconditionally reset all SSA
info such as range and alignment.
* tree-ssanames.h (reset_flow_sensitive_info): Declare.
* tree-ssanames.c (reset_flow_sensitive_info): New function.

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

2015-09-15  Richard Biener  

PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/torture/pr67055.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67271.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66793.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr66952.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67121.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67470.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/fold-const.c
branches/gcc-5-branch/gcc/gimple-ssa-isolate-paths.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-if-conv.c
branches/gcc-5-branch/gcc/tree-ssa-ccp.c
branches/gcc-5-branch/gcc/tree-ssa-ifcombine.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssanames.c
branches/gcc-5-branch/gcc/tree-ssanames.h


[Bug tree-optimization/67055] [5 Regression] Segmentation fault in fold_builtin_alloca_with_align in tree-ssa-ccp.c

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67055

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||5.2.0

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


[Bug tree-optimization/67121] [5 Regression] wrong code at -O3 on x86_64-linux-gnu

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67121

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||5.2.0

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


[Bug middle-end/67271] [5 Regression] ICE with -O1,2,3 on darwin14.5 x86_64

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67271

Richard Biener  changed:

   What|Removed |Added

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

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


[Bug middle-end/67639] ICE at -O1 and above on x86_64-linux-gnu in expand_gimple_basic_block, at cfgexpand.c:5697

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67639

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

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


[Bug target/55212] [SH] Switch to LRA

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #112 from Oleg Endo  ---
I had a quick look at the gcc.target/sh/hiconst.c test case:

int rab (char *pt, int *pti)
{
  pt[2] = 0;
  pti[3] = 0;

  return 0;
}

without LRA:
mov #0,r0
mov.b   r0,@(2,r4)
rts 
mov.l   r0,@(12,r5)


with LRA:
mov #0,r0
mov.b   r0,@(2,r4)
mov #0,r1
mov.l   r1,@(12,r5)
rts 
mov #0,r0

Without LRA it seems some of the constant loads are CSE'ed, but the return
value constant load remains and reload-something figures it out.  With LRA it
seems that for the SImode store it wants to use R1, but for the QImode store it
needs to use R0.  It then rematerializes the constant load.  Increasing the
costs of constants:

@@ -3574,7 +3574,7 @@
  return true;
}
   if (CONST_OK_FOR_I08 (INTVAL (x)))
-*total = 0;
+*total = 4;
   else if ((outer_code == AND || outer_code == IOR || outer_code == XOR)
   && CONST_OK_FOR_K08 (INTVAL (x)))
 *total = 1;

results in:
mov #0,r1
mov r1,r0
mov.b   r0,@(2,r4)
mov.l   r1,@(12,r5)
rts 
mov r1,r0

That would make the hiconst test pass again of course, but is not much better. 
Probably a combination of constant optimization (PR 65069, PR 63390, PR 51708,
PR 54682) and an R0 pre-alloc would give optimal results.


[Bug tree-optimization/67666] New: single restrict pointer in struct looses restrict

2015-09-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67666

Bug ID: 67666
   Summary: single restrict pointer in struct looses restrict
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider testcase test.c:
...
struct ps
{
  int *__restrict__ p;
};

void
f (struct ps &__restrict__ ps1)
{
  *(ps1.p) = 1;
}
...

Compile the test-case with g++ -O2, and we get one clique/base annotation at
ealias (the one for ps1, not the one for p):
...
void f(ps&) (struct psD.2252 & restrict ps1D.2255)
{
  intD.9 * _3;

  # VUSE <.MEM_1(D)>
  # PT = nonlocal escaped 
  _3 = MEM[(struct psD.2252 &)ps1_2(D) clique 1 base 1].pD.2254;

  # .MEM_4 = VDEF <.MEM_1(D)>
  *_3 = 1;
...

After applying the patch:
...
--- test7.c.orig2015-09-21 11:38:30.607225802 +0200
+++ test7.c 2015-09-21 11:29:40.891234983 +0200
@@ -1,6 +1,7 @@
 struct ps
 {
   int *__restrict__ p;
+  int a;
 };

 void
...

we get both clique/base annotations at ealias:
...
void f(ps&) (struct psD.2252 & restrict ps1D.2256)
{
  intD.9 * _3;

  # VUSE <.MEM_1(D)>
  # PT = { D.2263 } (nonlocal)
  _3 = MEM[(struct psD.2252 &)ps1_2(D) clique 1 base 1].pD.2254;

  # .MEM_4 = VDEF <.MEM_1(D)>
  MEM[(intD.9 *)_3 clique 1 base 2] = 1;
  # VUSE <.MEM_4>
...

Using this demonstrator patch, I manage to get both clique/base annotations at
ealias, without adding an 'int a' field to the struct:
...
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index b5b9d0a..e99feeb 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5675,8 +5675,7 @@ create_variable_info_for_1 (tree decl, const char *name)

   /* If we didn't end up collecting sub-variables create a full
  variable for the decl.  */
-  if (fieldstack.length () <= 1
-  || fieldstack.length () > MAX_FIELDS_FOR_FIELD_SENSITIVE)
+  if (fieldstack.length () > MAX_FIELDS_FOR_FIELD_SENSITIVE)
 {
   vi = new_var_info (decl, name);
   vi->offset = 0;
...


[Bug middle-end/60832] add pretty-printer code for double-int/wide-int

2015-09-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60832

--- Comment #2 from Manuel López-Ibáñez  ---
Author: manu
Date: Mon Sep 21 10:11:24 2015
New Revision: 227964

URL: https://gcc.gnu.org/viewcvs?rev=227964&root=gcc&view=rev
Log:
[PR middle-end/60832] Do not convert widest_int to tree just for printing it.

In do_warn_aggressive_loop_optimizations, we convert to a tree just to print a
widest_int. Apart from overly complicated, this results in printing '3u'
instead of just '3'.

Unfortunately, adding a printf-like conversion specifier would require making
pretty-print.c link with wide-int.cc, which will include a lot of new
dependencies into several other programs (gcov-tool for example). It would be
possible to add the conversion specifier to every FE pretty-printer, but this
still would require updating c-format.c, which is far from trivial. A simpler
approach is to convert to a string rather than to a tree.

In addition, "iteration 3 invokes undefined behavior within this loop" seems to
me clearer than "iteration 3 invokes undefined behavior; containing loop".

gcc/testsuite/ChangeLog:

2015-09-21  Manuel López-Ibáñez  

PR middle-end/60832
* gcc.dg/pr53265.c: Update.

gcc/ChangeLog:

2015-09-21  Manuel López-Ibáñez  

PR middle-end/60832
* tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations):
Print i_bound without converting it to a tree.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr53265.c
trunk/gcc/tree-ssa-loop-niter.c

[Bug tree-optimization/67666] single restrict pointer in struct looses restrict

2015-09-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67666

--- Comment #1 from vries at gcc dot gnu.org ---
Created attachment 36360
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36360&action=edit
Tentative patch


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #6 from Markus Trippelsdorf  ---
I guess valgrind just needs to be silenced in this case.
See valgrind related macros in gcc/system.h.


[Bug tree-optimization/67666] single restrict pointer in struct looses restrict

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67666

--- Comment #2 from Richard Biener  ---
Looks good to me.  The other possibility is to init ->only_restrict_pointers
from
the single entry.


[Bug middle-end/60832] add pretty-printer code for double-int/wide-int

2015-09-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60832

--- Comment #3 from Manuel López-Ibáñez  ---
Created attachment 36361
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36361&action=edit
add %Wi %Wu %Wd for pretty-printing wides_int

This fails bootstrap at:

libcommon.a(pretty-print.o): In function `pp_format(pretty_printer*,
text_info*)':
/home/manuel/test1/src/gcc/pretty-print.c:543: undefined reference to
`print_dec(generic_wide_int > const&, char*,
signop)'
/home/manuel/test1/src/gcc/pretty-print.c:573: undefined reference to
`print_dec(generic_wide_int > const&, char*,
signop)'
collect2: error: ld returned 1 exit status
make: *** [gcov] Error 1

pretty-print.c is used all over the place and adding a dependency on
wide-int.cc will bring gmp and other stuff that is currently  not used (nor
linked with) various helper programs. If wide-int is only printed in the
middle-end, perhaps it is sufficient to add it to default_tree_printer.
Otherwise, it needs to be added to every FE. This is not difficult just
tedious. The difficult part is the c-format.c changes (I wish someone would fix
https://gcc.gnu.org/PR47781 so we can use a simpler syntax to define our custom
specifiers; in addition to the positive synergies it will bring with other GNU
projects that use custom specifiers and wish to use -Wformat).

[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread miyuki at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #7 from Mikhail Maltsev  ---
Probably. Will look at this today (valgrind has some sort of memory pool API, I
think it can be used here).
I need to configure GCC with --enable-checking=yes,valgrind to reproduce this,
right?


[Bug middle-end/67649] trunk build with valgrind fail in get_def_blocks_for

2015-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67649

--- Comment #8 from Markus Trippelsdorf  ---
--enable-checking=valgrind is enough


[Bug bootstrap/67622] [6 regression] Solaris/SPARC bootstrap fails compiling stage2 stdc++.h.gch/O2ggnu++0x.gch

2015-09-21 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67622

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
The reghunt revealed (not completely unexpected) the following patch as
the culprit:

The first bad revision is:
changeset:   25098:fa3edfa6a9a7
user:davem@138bc75d-0d04-0410-961f-82ee72b054a4
date:Sat Sep 12 00:13:23 2015 +
summary: Convert SPARC backend over to LRA.

Rainer


[Bug tree-optimization/67607] Failure to perform constant folding through type conversion

2015-09-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67607

--- Comment #3 from Marc Glisse  ---
Created attachment 36362
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36362&action=edit
shortening

The shortening case seems much easier and does not require VRP information.

Calling get_range_info from match.pd is not done now (not sure if it would be a
good idea or not), so the widening case may have to be written separately in
VRP.


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #9 from Oleg Endo  ---
(In reply to Oleg Endo from comment #7)
> Created attachment 36357 [details]
> Proposed patch
> 
> Although a "mov @r2+,r2" is actually possible and valid (r2 will contain the
> value loaded from memory, AFAIR), it doesn't make sense to keep the
> post-inc, as the result will be overwritten anyway.  The patch catches those
> cases in the peepholes and removes the post-inc.  I'm now testing this on
> sh-elf.

No new failures on sh-elf for make -k check
RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #10 from John Paul Adrian Glaubitz  ---
(In reply to Oleg Endo from comment #1)
> Thanks for reporting.  I was a bit confused ... the attached source is not
> cselib.c (which is a GCC file) but rather the problematic jidctflt.c

Oops, my bad, sorry!

(In reply to Oleg Endo from comment #8)
> BTW, I'd recommend not specifying -ffloat-store on SH.  It doesn't affect FP
> precision (unlike on x86) and just creates slower code.

Ok, I will send a bug report to the maintainers of libjpeg-turbo regarding
this, using your comment as reference.

(In reply to Oleg Endo from comment #9)
> No new failures on sh-elf for make -k check
> RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-
> mb,-m4a/-ml,-m4a/-mb}"

Sounds good, thanks!

Adrian


[Bug libstdc++/67647] [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67647

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Mon Sep 21 11:44:08 2015
New Revision: 227966

URL: https://gcc.gnu.org/viewcvs?rev=227966&root=gcc&view=rev
Log:
Fix bootstrap error introduced in r227870

PR libstdc++/67647
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::shrink_to_fit): Fix #endif placement.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/basic_string.h


[Bug libstdc++/67647] [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67647

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #3 from Jonathan Wakely  ---
Fixed now, thanks for the report.


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #11 from Oleg Endo  ---
(In reply to John Paul Adrian Glaubitz from comment #10)
> (In reply to Oleg Endo from comment #1)
> > Thanks for reporting.  I was a bit confused ... the attached source is not
> > cselib.c (which is a GCC file) but rather the problematic jidctflt.c
> 
> Oops, my bad, sorry!

No problem.

> 
> (In reply to Oleg Endo from comment #8)
> > BTW, I'd recommend not specifying -ffloat-store on SH.  It doesn't affect FP
> > precision (unlike on x86) and just creates slower code.
> 
> Ok, I will send a bug report to the maintainers of libjpeg-turbo regarding
> this, using your comment as reference.

Instead, they might want to try -ffast-math for the FP code...

> (In reply to Oleg Endo from comment #9)
> > No new failures on sh-elf for make -k check
> > RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-
> > mb,-m4a/-ml,-m4a/-mb}"
> 
> Sounds good, thanks!

I'd be surprised if it caught anything.  After all, this bug has not been
detected by the testsuite nor by the GCC 5 bootstrap.  I guess I'll just commit
it to trunk and GCC 5 branch.


[Bug target/55212] [SH] Switch to LRA

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #113 from Oleg Endo  ---
Created attachment 36363
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36363&action=edit
CSiBE I08 const cost = 0 vs. cost = 1, no LRA


[Bug target/55212] [SH] Switch to LRA

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #114 from Oleg Endo  ---
Created attachment 36364
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36364&action=edit
CSiBE I08 const cost = 0 vs. cost = 1, LRA


[Bug c/67667] New: erroneous type argument for unary operator one's complement

2015-09-21 Thread ka_bena at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67667

Bug ID: 67667
   Summary: erroneous type argument for unary operator one's
complement
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ka_bena at yahoo dot fr
  Target Milestone: ---


[Bug target/55212] [SH] Switch to LRA

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #115 from Oleg Endo  ---
It seems that it's already enough to set the cost for I08 from 0 to 1:

Index: gcc/config/sh/sh.c
===
--- gcc/config/sh/sh.c  (revision 227958)
+++ gcc/config/sh/sh.c  (working copy)
@@ -3574,7 +3574,7 @@
  return true;
}
   if (CONST_OK_FOR_I08 (INTVAL (x)))
-*total = 0;
+*total = 1;
   else if ((outer_code == AND || outer_code == IOR || outer_code == XOR)
   && CONST_OK_FOR_K08 (INTVAL (x)))
 *total = 1;

This will reduce the rematerializations and thus increase reg live ranges in
other places.

attachment 36363 and attachment 36364 are CSiBE comparistions with and without
LRA.

Without LRA: sum:  3347407 -> 3345667-1740 / -0.051981 %
With LRA:sum:  3348933 -> 3347433-1500 / -0.044790 %

Although there are quite some increases, overall it seems beneficial...


[Bug c/67668] New: erroneous type argument for unary operator one's complement

2015-09-21 Thread ka_bena at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668

Bug ID: 67668
   Summary: erroneous type argument for unary operator one's
complement
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ka_bena at yahoo dot fr
  Target Milestone: ---

int main(void)
{ 
  ~( 1. + 0.i ) ; 
  ~(1.)   ; 
  return 0  ;
}

/* Results:: 
   main_cmp1_err.c:4:3: attention : statement with no effect [-Wunused-value]
  ~( 1. + 0.i ) ; 
  ^
   main_cmp1_err.c:5:3: erreur: type d'argument erroné pour un complément de
bit
  ~(1.)   ; 
  ^
   Comment:: ( 1. + 0.i ) must be an erroneous type argument for ~ . 

   Microsoft Windows XP Profesional version2002 Service Pack 3.
   Gcc 4.8.0 win32 mingw32  
*/

[Bug c/67667] erroneous type argument for unary operator one's complement

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67667

Jonathan Wakely  changed:

   What|Removed |Added

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

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

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


[Bug c/67668] erroneous type argument for unary operator one's complement

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668

--- Comment #1 from Jonathan Wakely  ---
*** Bug 67667 has been marked as a duplicate of this bug. ***


[Bug middle-end/67651] Optimizer assumes nothing can reside at address 0 despite -fno-delete-null-pointer-checks

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67651

--- Comment #4 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 12:33:23 2015
New Revision: 227968

URL: https://gcc.gnu.org/viewcvs?rev=227968&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

PR middle-end/67651
* rtlanal.c (nonzero_address_p): SYMBOL_REFs may have zero
address with -fno-delete-null-pointer-checks.

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


[Bug middle-end/67651] Optimizer assumes nothing can reside at address 0 despite -fno-delete-null-pointer-checks

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67651

Richard Biener  changed:

   What|Removed |Added

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

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


[Bug c/67668] erroneous type argument for unary operator one's complement

2015-09-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668

--- Comment #2 from Marc Glisse  ---
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/Complex.html
-Wpedantic

What is your question exactly?


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #12 from Oleg Endo  ---
Author: olegendo
Date: Mon Sep 21 12:57:31 2015
New Revision: 227969

URL: https://gcc.gnu.org/viewcvs?rev=227969&root=gcc&view=rev
Log:
gcc/
PR target/67657
* config/sh/sh.c (sh_remove_overlapping_post_inc,
sh_peephole_emit_move_insn): Add new functions.
* config/sh/sh-protos.h (sh_remove_overlapping_post_inc,
sh_peephole_emit_move_insn): Declere them.
* config/sh/sh.md: Use them in various peephole2 patterns.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sh-protos.h
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md


[Bug other/67300] -foffload* undocumented

2015-09-21 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67300

Thomas Schwinge  changed:

   What|Removed |Added

   Keywords||openmp
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 CC||bernds at gcc dot gnu.org,
   ||iverbin at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Thomas Schwinge  ---
(As you have found already), -foffload=[...] currently is only documented on
, and in the patch submission email,
.
 This documentation should be moved into the GCC users manual.


[Bug c/67652] liboffloadmic/runtime/offload_engine.cpp:176: strange expression in sizeof ?

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67652

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 CC||iverbin at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
That certainly looks wrong.


[Bug target/67657] [SH][5/6 Regression]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67657

--- Comment #13 from Oleg Endo  ---
Author: olegendo
Date: Mon Sep 21 13:14:45 2015
New Revision: 227970

URL: https://gcc.gnu.org/viewcvs?rev=227970&root=gcc&view=rev
Log:
gcc/
Backport from mainline
2015-09-21  Oleg Endo  

PR target/67657
* config/sh/sh.c (sh_remove_overlapping_post_inc,
sh_peephole_emit_move_insn): Add new functions.
* config/sh/sh-protos.h (sh_remove_overlapping_post_inc,
sh_peephole_emit_move_insn): Declere them.
* config/sh/sh.md: Use them in various peephole2 patterns.

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


[Bug c/67652] liboffloadmic/runtime/offload_engine.cpp:176: strange expression in sizeof ?

2015-09-21 Thread iverbin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67652

iverbin at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #2 from iverbin at gcc dot gnu.org ---
Thanks, I will fix it.


[Bug c++/67669] New: Wrong works fwrite or fread or both

2015-09-21 Thread beyzman at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67669

Bug ID: 67669
   Summary: Wrong works fwrite or fread or both
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: beyzman at gmail dot com
  Target Milestone: ---

Created attachment 36365
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36365&action=edit
Example of file to be processed

The program below is intended to replace every symbol with code \x00 by symbol
\x20 in some file.
The program was compiled by g++ for Windows from MinGW packet.
In the example attached there is symbols with code \x00 after every symbols
'j'.
It is intended that after program is executed, there will be symbols with code
\x20 after every symbol 'j'. But it is not so.
If I decomment 2 lines commented, the programm works as intended.



//#include 
#include 
#pragma hdrstop
#define min(a, b)  (((a) < (b)) ? (a) : (b))

int main(int argc, char *argv[])
{
   FILE *f;
   int pos;
   const int bufSize = 10;
   int length;
   int piece;
   int i;
   int ret;
   int chSw = 0;
   const char *fileName = argv[1];
   char *buf;
   if (argc < 1) printf("USAGE:  02space.exe \nReplaces every symbol
\\0x00 by space\n");
   f = fopen(fileName,"rb+");
   if (!f)
   {
   printf("Can not open file %s",argv[1]);
   return -1;
   }
   fseek(f,0,SEEK_END);
   length = ftell(f);
   rewind (f);
   ret = 0;
   buf = new char[bufSize];
   for(piece = (int)(min(bufSize,length)); length > 0;
 length -= piece,piece = (int)(min(bufSize,length)))
   {
 ++ret;
 pos = ftell(f)  ;
 fread(buf,piece,1,f);
 chSw = 0;
 for (i = 0; i < piece; ++i)
 {
 if (buf[i] == '\x00')
 {
 buf[i] = ' ';
 chSw = 1;
 }
 }

 if (chSw)
 {

   fseek(f,pos,SEEK_SET);
   fwrite(buf,piece,1,f);
//   fseek(f,pos,SEEK_SET);
//   fread(buf, piece, 1,f);
 }
   }

   delete [] buf;
   fclose(f);
   return 0;
}


[Bug c++/67669] Wrong works fwrite or fread or both

2015-09-21 Thread beyzman at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67669

--- Comment #1 from Bernard  ---
Created attachment 36366
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36366&action=edit
Source


[Bug c++/67669] Wrong works fwrite or fread or both

2015-09-21 Thread beyzman at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67669

--- Comment #2 from Bernard  ---
The same source compiled for UBUNTU works well.


[Bug middle-end/57625] internal compiler error: seg fault when building gcc 4.7.2

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57625

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #7 from Marek Polacek  ---
Looks resolved then.


[Bug target/64345] [SH] Improve single bit extraction

2015-09-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64345

--- Comment #5 from Oleg Endo  ---
Author: olegendo
Date: Mon Sep 21 13:49:07 2015
New Revision: 227971

URL: https://gcc.gnu.org/viewcvs?rev=227971&root=gcc&view=rev
Log:
testsuite/
PR target/64345
* gcc.target/sh/pr64345-1.c: Adjust expected insn counts for SH2A.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/sh/pr64345-1.c


[Bug sanitizer/64906] -fsanitize=integer-divide-by-zero creates false -Wmaybe-uninitialized warning

2015-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64906

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
I'll have a look.


[Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

--- Comment #4 from Richard Biener  ---
Author: rguenth
Date: Mon Sep 21 14:02:27 2015
New Revision: 227972

URL: https://gcc.gnu.org/viewcvs?rev=227972&root=gcc&view=rev
Log:
2015-09-21  Richard Biener  

PR debug/67664
* dwarf2out.c (add_location_or_const_value_attribute): Remove
attribute parameter.  Early exit if either DW_AT_const_value
or DW_AT_location are present already.
(gen_variable_die): Adjust caller.
(dwarf2out_late_global_decl): Likewise.

* g++.dg/debug/dwarf2/pr67764.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/pr67764.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog


[Bug debug/67664] [6 Regression] Duplicate AT_const_value attributes in some c++ cases.

2015-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67664

Richard Biener  changed:

   What|Removed |Added

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

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


[Bug tree-optimization/67628] [tree-optimization] (a && b) && c shows better codegen than a && (b && c)

2015-09-21 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67628

--- Comment #4 from ktkachov at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #3)
> (In reply to ktkachov from comment #2)
> > (In reply to Andrew Pinski from comment #1)
> > > This is due to the fold-const.c optimization which should not be there any
> > > more. You need to do benchmarking on x86 also if you remove it. 
> > > 
> > 
> > could you elaborate what optimization is that?
> > Is it a matter of fold-const.c or match.pd canonicalizing the expression in
> > some way?
> 
> The optimization is converting andif into and. Basically ifcombine pass does
> not recombine them if fold-const does it early on.

Right, seems like the code in fold_truth_andor.
I think ifcombine should be doing a better job here though


[Bug c++/67670] New: [c++11] Misleading / outdated error message "invalid pure specifier"

2015-09-21 Thread arvo at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67670

Bug ID: 67670
   Summary: [c++11] Misleading / outdated error message "invalid
pure specifier"
   Product: gcc
   Version: 5.1.1
Status: UNCONFIRMED
  Severity: trivial
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: arvo at me dot com
  Target Milestone: ---

Created attachment 36367
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36367&action=edit
Minimal test program (no headers/macros)

g++ (Ubuntu 5.1.1-4ubuntu12) 5.1.1 20150504
x86_64 GNU/Linux
Ubuntu 15.04
Command line: g++ -c -std=c++11 wrong-default.cxx

command output:
wrong-default.cxx:6:17: error: invalid pure specifier (only ‘= 0’ is allowed)
before ‘;’ token
 X::X() = defaut;
^
wrong-default.cxx:6:17: error: function ‘X::X()’ is initialized like a variable

I am not suggesting a "Did you mean 'default'?" message, but, in C++11,
obviously the statement "only '= 0' is allowed" is wrong. That is true for the
*pure-specifier*, an optional part of a *member-declarator*, but '= default' or
'= delete' is valid as a *function-body* in a *function-definition*. Curiously,
a *member-declarator* may only occur inside a *class-specifier*, which means
that '= 0' is not even allowed here, even for a virtual method of X (though I
am only looking at draft N3690).

[Bug c/67668] erroneous type argument for unary operator one's complement

2015-09-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668

Manuel López-Ibáñez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||manu at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #3 from Manuel López-Ibáñez  ---
Marc is right:

The operator ‘~’ performs complex conjugation when used on a value with a
complex type. This is a GNU extension; for values of floating type, you should
use the ISO C99 functions conjf, conj and conjl, declared in  and
also provided as built-in functions by GCC. 

test.c:3:3: warning: ISO C does not support ‘~’ for complex conjugation
[-Wpedantic]
   ~( 1. + 0.i ) ; 
   ^

[Bug c++/67670] [c++11] Misleading / outdated error message "invalid pure specifier"

2015-09-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67670

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-09-21
 Ever confirmed|0   |1
   Severity|trivial |normal

--- Comment #1 from Jonathan Wakely  ---
I thought we already had a PR for this, but I can't find it.


[Bug c/66415] [6 Regression] ice in location_column_from_byte_offset

2015-09-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66415

--- Comment #10 from Manuel López-Ibáñez  ---
Author: manu
Date: Mon Sep 21 14:52:09 2015
New Revision: 227975

URL: https://gcc.gnu.org/viewcvs?rev=227975&root=gcc&view=rev
Log:
Handle lines encoded into several maps in linemap_position_for_loc_and_offset

linemap_position_for_loc_and_offset() tries to generate a location_t
encoding a column offset from the current location, for example, point
to a certain character inside a string. This is trivial to do when the
new location "fits within" the map of the original location. However,
it may happen that the (long) line corresponding to the original
location is encoded in several maps, thus the new location should
actually be encoded in a subsequent map from the original location.
This patch detects this case and adjusts the map correspondingly.

(This shows that the line-map representation is quite wasteful in this
case, because line-maps always start at column 0. That is, map[0]
highest location may encode up to line 8 column 80, then
map[1]->start_location starts encoding at line 8 column 0. Thus, there
are two location_t values that point to the same source location.)

libcpp/ChangeLog:

2015-09-21  Manuel López-Ibáñez  

PR c/66415
* line-map.c (linemap_position_for_loc_and_offset): Handle the
case of long lines encoded in multiple maps.

gcc/testsuite/ChangeLog:

2015-09-21  Manuel López-Ibáñez  

PR c/66415
* gcc.dg/cpp/pr66415-1.c: Test column number.



Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/cpp/pr66415-1.c
trunk/libcpp/ChangeLog
trunk/libcpp/line-map.c

[Bug tree-optimization/67671] New: restrict pointer reference looses restrict

2015-09-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67671

Bug ID: 67671
   Summary: restrict pointer reference looses restrict
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider test-case test.c:
...
void
f (int *__restrict__ &__restrict__ p)
{
  *p = 1;
}
...

When compiling the test-case with g++ -O2, we find one clique/base annotation
at ealias:
...
void f(int* __restrict__&) (intD.9 * restrict & restrict pD.2252)
{
  intD.9 * _3;

  # VUSE <.MEM_1(D)>
  # PT = nonlocal escaped
  _3 = MEM[(intD.9 * restrict &)p_2(D) clique 1 base 1];

  # .MEM_4 = VDEF <.MEM_1(D)>
  *_3 = 1;
...

If we write an equivalent example using a struct with pointer field instead:
...
struct ps {
  int *__restrict__ p;
}

f (struct ps &__restrict__ ps)
{
  *(ps.p) = 1;
}
...
we get two clique/base annotations at ealias (after fixing PR67666).

I think the two examples are similar enough to expect two clique/base
annotations at ealias for the first example.

Using this demonstrator patch, we manage that:
...
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 94016b9..fa7108a 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5684,6 +5684,9 @@ create_variable_info_for_1 (tree decl, const char *name)
   vi->fullsize = tree_to_uhwi (declsize);
   vi->size = vi->fullsize;
   vi->is_full_var = true;
+  if (POINTER_TYPE_P (TREE_TYPE (decl))
+ && TYPE_RESTRICT (TREE_TYPE (decl)))
+   vi->only_restrict_pointers = 1;
   fieldstack.release ();
   return vi;
 }
...


[Bug middle-end/67619] ICE at -O1 and above on x86_64-linux-gnu in int_mode_for_mode, at stor-layout.c:425

2015-09-21 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67619

--- Comment #4 from uros at gcc dot gnu.org ---
Author: uros
Date: Mon Sep 21 15:23:52 2015
New Revision: 227976

URL: https://gcc.gnu.org/viewcvs?rev=227976&root=gcc&view=rev
Log:
PR middle-end/67619
* except.c (expand_builtin_eh_return): Use copy_addr_to_reg to copy
the address to a register.

testsuite/ChangeLog:

PR middle-end/67619
* gcc.dg/torture/pr67619.c: New test.
* lib/target-supports.exp (check_effective_target_builtin_eh_return):
New procedure.


Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67619.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/except.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/lib/target-supports.exp


[Bug bootstrap/67672] New: [6 regression] Ada "Storage_Error stack overflow or erroneous memory access" error breaks sparc-linux bootstrap

2015-09-21 Thread mikpelinux at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67672

Bug ID: 67672
   Summary: [6 regression] Ada "Storage_Error stack overflow or
erroneous memory access" error breaks sparc-linux
bootstrap
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Attempting to bootstrap gcc-6-20150920 (r227952) on sparc-linux (sparc64-linux
with options to default to -m32) fails with:

/mnt/scratch/objdir6/./prev-gcc/xgcc -B/mnt/scratch/objdir6/./prev-gcc/
-B/mnt/scratch/install6/sparc-unknown-linux/bin/
-B/mnt/scratch/install6/sparc-unknown-linux/bin/
-B/mnt/scratch/install6/sparc-unknown-linux/lib/ -isystem
/mnt/scratch/install6/sparc-unknown-linux/include -isystem
/mnt/scratch/install6/sparc-unknown-linux/sys-include-c -g -O2  -gnatpg  -W
-Wall -nostdinc -I- -I. -Iada/generated -Iada
-I/mnt/scratch/gcc-6-20150920/gcc/ada
-I/mnt/scratch/gcc-6-20150920/gcc/ada/gcc-interface
/mnt/scratch/gcc-6-20150920/gcc/ada/checks.adb -o ada/checks.o
+===GNAT BUG DETECTED==+
| 6.0.0 20150920 (experimental) (sparc-unknown-linux) Storage_Error stack
overflow or erroneous memory access|
| Error detected at checks.adb:3061:16 |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.|
| Use a subject line meaningful to you and us to track the bug.|
| Include the entire contents of this bug box in the report.   |
| Include the exact command that you entered.  |
| Also include sources listed below.   |
+==+

(long list of files omitted)

compilation abandoned
make[3]: *** [ada/checks.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir6/gcc'
make[2]: *** [all-stage3-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir6'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir6'
make: *** [bootstrap] Error 2

gcc-6-20150809 bootstrapped fine, later snapshots failed due to PR67475.

Configuration options:
/mnt/scratch/gcc-6-20150920/configure --prefix=/mnt/scratch/install6
--with-gmp=/home/mikpe/pkgs/linux-sparc64/gmp-6.0.0
--with-mpfr=/home/mikpe/pkgs/linux-sparc64/mpfr-3.1.3
--with-mpc=/home/mikpe/pkgs/linux-sparc64/mpc-1.0.3 --enable-multilib
--disable-plugin --disable-lto --disable-nls --enable-threads=posix
--enable-checking=release --disable-libmudflap --enable-languages=c,ada,c++
--build=sparc-unknown-linux --target=sparc-unknown-linux --with-cpu=ultrasparc
--enable-targets=all


[Bug tree-optimization/62171] restrict pointer to struct with restrict pointers parm doesn't prevent aliases

2015-09-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62171

--- Comment #6 from vries at gcc dot gnu.org ---
(In reply to Richard Biener from comment #2)
> And maybe set DECL_BY_REFERENCE, a mere REFERENCE_TYPE doesn't prevent
> you from doing (¶m)[2] which we'd miscompile.  Not sure who added
> that REFERENCE_TYPE code.

Richard,

can you give a complete example of what you think we'd miscompile?

Thanks,
- Tom


[Bug rtl-optimization/66790] Invalid uninitialized register handling in REE

2015-09-21 Thread derodat at adacore dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790

--- Comment #27 from Pierre-Marie de Rodat  ---
Firstly, thanks everyone for your help! I'll try to address points that
still are unresolved.



(In reply to Bernd Schmidt from comment #14)
> As you say, the df-live problem claims to compute a must-initialized
> problem, so it would be very odd to add another problem with the same name.
(In reply to Eric Botcazou from comment #21)
> (In reply to Paolo Bonzini from comment #19)
>> There's no code in GCC for must-initialized.  Pierre's patch gets it right
>> (except that I'm not sure about the comment at line 2033).  The MIR name can
>> indeed add to the confusion about may/must.  Perhaps valid registers (VR)?
> 
> Thanks for the comment.  Yes, I agree that the MIR name ought to be improved.
To me, "valid" register has the same meaning as "initialized" and thus
does not carry the information about whether we can assume it is either
always or sometimes valid/initialized. So what about "always initialized
registers"? The acronym would be AIR.



(In reply to Bernd Schmidt from comment #14)
> I experimented with changing df_live_confluence_n to use and instead of ior,
> followed by actually taking the confluence_n from your mir problem. However,
> this does not work: ior enlarges the set while and shrinks it, so the
> initialization of the bitmaps would have to be different.
Yes: they both compute different information as discussed later in this
thread.



(In reply to Bernd Schmidt from comment #14)
> It looks like your "visited" bit tries to avoid that, but I don't
> think this works.
(In reply to Paolo Bonzini from comment #19)
> There's no code in GCC for must-initialized.  Pierre's patch gets it right
> (except that I'm not sure about the comment at line 2033).
The "visited" bit I introduced is used to fake an "all bits set"
initialization. The confluence_n method is meant to do:

IN(dest) = OUT(src_0) AND OUT(src_1) AND ...

... by small increments of:

IN(dest) := IN(dest) AND OUT(src_i)

When it is executed for the first time, IN(dest) is all-zeros, so we do
a copy because "a AND all_ones = a". Then we can do regular AND later
on. In order to get rid of this "visited" bit, I guess we could instead
pretend that IN/OUT sets are set of never-or-may-initialized registers,
but this complicates other parts of the code, so...

Paolo, does this clarify the comment at line 2033? (I will update it if
you think this is enough :-))



(In reply to Bernd Schmidt from comment #14)
> One testcase I looked at had this structure:
> 
> entry -> 2 -> 3 -> 3
> 
> i.e. a loop in  block 3. The confluence_n function takes the out bitmap from
> block 3 (which is all zeros) and ands it with the in bitmap from the same
> block, which has the incoming regs from block 2 at that point, but obviously
> the bitmap turns into all zeros at this point (block 3 was already visited
> due to the 2->3 edge). I don't see how your patch doesn't suffer from the
> same problem.
I don't understand what the problem is: the confluence_n function is
used during forward propagation. So in your example:

 a. the confluence_n function will be called for the 3 -> edge only
after...

 b. the transfer function is invoked for the basic block 3 (then OUT(3)
is initialized and potentially not all-zeros); this will be invoked
only after...

 c. the confluence_n function is invoked for the 2 -> 3 edge
(then IN(3) is initialized and potentially not all-zeros).

If I understand correctly, the BB_LAST_CHANGE_AGE mechanism in df-core.h
makes sure computations comply with this dependency (c. before b., b.
before a.).  So at the point the confluence_n function for the 3 -> 3
edges is called for the first time, both IN(3) and OUT(3) can be not
all-zeros.



(In reply to Bernd Schmidt from comment #14)
> I do have to say that I am still uncomfortable with changing RRE to
> use a MUST problem rather than a MAY problem.   I see this as dumbing
> down the compiler to provide the semantics of uninitialized variables
> and it is a path that we have generally avoided in GCC. I do not have
> a better solution, but there is a feeling that something is being
> missed here.
Indeed, while trying to fix the bug, I noticed that no RTL pass needs
this "is initialized on all paths" information.

I'm not sure what "having no semantics for uninitialized variables"
really implies: does this mean that we have an undefined behavior as
soon as code uses the value of an uninitialized variable? If not, I
think what makes REE special regarding this is that zero-extension is
used to pack independent values into single storage units (registers).
Because of this, considering that the whole storage unit is
uninitialized because a single embedded value is uninitialized makes us
generate wrong code.



Now on a different topic, I forgot to mention with my first candidate
patch: LIVE and MIR are supposed to work on the same GEN/KILL sets.
These respectively represent the s

[Bug rtl-optimization/66790] Invalid uninitialized register handling in REE

2015-09-21 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790

--- Comment #28 from Bernd Schmidt  ---
(In reply to Pierre-Marie de Rodat from comment #27)
> (In reply to Bernd Schmidt from comment #14)
> > It looks like your "visited" bit tries to avoid that, but I don't
> > think this works.
> (In reply to Paolo Bonzini from comment #19)
> > There's no code in GCC for must-initialized.  Pierre's patch gets it right
> > (except that I'm not sure about the comment at line 2033).
> The "visited" bit I introduced is used to fake an "all bits set"
> initialization. The confluence_n method is meant to do:
> 
> IN(dest) = OUT(src_0) AND OUT(src_1) AND ...
> 
> ... by small increments of:
> 
> IN(dest) := IN(dest) AND OUT(src_i)
> 
> When it is executed for the first time, IN(dest) is all-zeros, so we do
> a copy because "a AND all_ones = a". Then we can do regular AND later
> on. In order to get rid of this "visited" bit, I guess we could instead
> pretend that IN/OUT sets are set of never-or-may-initialized registers,
> but this complicates other parts of the code, so...

I know this is what it's trying to do, but when I experimented with it that
wasn't working, due to the problem I described.

> If I understand correctly, the BB_LAST_CHANGE_AGE mechanism in df-core.h
> makes sure computations comply with this dependency (c. before b., b.
> before a.).  So at the point the confluence_n function for the 3 -> 3
> edges is called for the first time, both IN(3) and OUT(3) can be not
> all-zeros.

It is sufficient for OUT(3) to be all-zeros. And I don't think the
LAST_CHANGE_AGE mechanism does anything to prevent it. Please try it out. I
think you have to initialize your bitmaps correctly rather than rely on
"visited".

I applied your patch and compiled the following with a breakpoint on
df_mir_confluence_n:
int foo (int n)
{
  int sum = 0;
  for (int i = 0; i < n; i++)
sum += i;
  return sum;
}

and when it reaches the loop:

Breakpoint 5, df_mir_confluence_n (e= 4)>) at
../../trunk/gcc/df-problems.c:2040
(gdb) p debug_bitmap (op1)

first = 0x24bf418 current = 0x24bf418 indx = 0
0x24bf418 next = (nil) prev = (nil) indx = 0
bits = { 0 1 2 4 5 7 17 21 22 23 24 25
 26 27 28 37 38 }
$2 = void
(gdb) p debug_bitmap (op2)

first = (nil) current = (nil) indx = 0

and

(gdb) p bb_info->visited 
$5 = true

because the edge 3->4 was seen first.

> (In reply to Bernd Schmidt from comment #14)
> > I do have to say that I am still uncomfortable with changing RRE to

I did not write this.


[Bug tree-optimization/67673] New: support restrict pointer to restrict pointer

2015-09-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67673

Bug ID: 67673
   Summary: support restrict pointer to restrict pointer
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

The test-case gcc/testsuite/g++.dg/tree-ssa/restrict2.C contains an xfail:
...
struct S { int *__restrict p; int q; };

int
f5 (S *__restrict x, S *__restrict y)
{
  x->p[0] = 5;
  y->p[0] = 0;
// We might handle this some day
// { dg-final { scan-tree-dump-times "return 5" 1 "optimized" { xfail *-*-* } }
}
  return x->p[0];
}
...

See also https://gcc.gnu.org/ml/gcc-patches/2011-09/msg01466.html .


[Bug fortran/67615] ICE on using arithmetic if with array instead of scalar

2015-09-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67615

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Sep 21 18:09:13 2015
New Revision: 227981

URL: https://gcc.gnu.org/viewcvs?rev=227981&root=gcc&view=rev
Log:
2015-09-21  Steven G. Kargl  

PR fortran/67615
* resolve.c (gfc_resolve_code): Check for scalar expression in 
arithmetic-if.


2015-09-21  Steven G. Kargl  

PR fortran/67615
* gfortran.dg/pr67615.f90: new test.


Added:
trunk/gcc/testsuite/gfortran.dg/pr67615.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


  1   2   >