[Bug target/67211] New: [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Bug ID: 67211
   Summary: [5 Regression] ICE (insn does not satisfy its
constraints) on powerpc64le-linux-gnu
   Product: gcc
   Version: 5.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen with r226731 from the gcc-5-branch, fails with -O3, succeeds with -O2. on
powerpc64le-linux-gnu. not seen with r226068 on the trunk.

$ g++ -c -g -O3 structure.ii
structure.ii:38:3: warning: anonymous type with no linkage used to declare
variable ' a' with linkage
 } a;
   ^
structure.ii: In function 'void Linked()':
structure.ii:42:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 305 170 306 8 (set (reg:DI 9 9)
(reg/f:DI 63 31 [orig:184 p3$_M_node ] [184])) structure.ii:20 554
{*movdi_internal64}
 (nil))
structure.ii:42:1: internal compiler error: in extract_constrain_insn, at
recog.c:2246
0x107528d3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../src/gcc/rtl-error.c:110
0x1075292b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../src/gcc/rtl-error.c:121
0x1071b7e7 extract_constrain_insn(rtx_insn*)
../../src/gcc/recog.c:2246
0x106f8527 reload_cse_simplify_operands
../../src/gcc/postreload.c:430
0x106f9983 reload_cse_simplify
../../src/gcc/postreload.c:207
0x106f9983 reload_cse_regs_1
../../src/gcc/postreload.c:246
0x106fb697 reload_cse_regs
../../src/gcc/postreload.c:94
0x106fb697 execute
../../src/gcc/postreload.c:2387
Please submit a full bug report,
with preprocessed source if appropriate.

$ cat structure.ii
template 
void find_first_of(_InputIterator, _InputIterator, _ForwardIterator p3,
   _ForwardIterator p4) {
  for (; p3 != p4; ++p3)
;
}

template  struct A {
  int _S_buffer_size;
  int *_M_cur;
  int *_M_first;
  int *_M_last;
  int **_M_node;
  void operator++() {
if (_M_cur == _M_last)
  m_fn1(_M_node + 1);
  }
  void m_fn1(int **p1) {
_M_node = p1;
_M_first = *p1;
_M_last = _M_first + _S_buffer_size;
  }
};

template 
bool operator==(A<_Tp, _Ref, _Ptr>, A<_Tp, _Ref, _Ptr>);
template 
bool operator!=(A<_Tp, _Ref, _Ptr> p1, A<_Tp, _Ref, _Ptr> p2) {
  return p1 == p2;
}

class B {
public:
  A m_fn2();
};
struct {
  B j;
} a;
void Linked() {
  A b, c, d;
  find_first_of(d, c, b, a.j.m_fn2());
}


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf  ---
I cannot reproduce this with:
gcc version 5.2.1 20150814 (GCC)

Please post the full output of -v invocation.


[Bug fortran/44348] ICE in build_function_decl

2015-08-14 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44348

--- Comment #9 from Vittorio Zecca  ---
No, it is not valid, but gfortran should signal this with an error message.
Not with a crash.


[Bug libfortran/62296] EXECUTE_COMMAND_LINE not F2008 conforming

2015-08-14 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62296

Francois-Xavier Coudert  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
 CC||fxcoudert at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |fxcoudert at gcc dot 
gnu.org

--- Comment #7 from Francois-Xavier Coudert  ---
Patch proposed: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00758.html


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

--- Comment #2 from Matthias Klose  ---
Using built-in specs.
COLLECT_GCC=g++
Target: powerpc64le-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-15ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-libquadmath --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-ppc64el
--with-arch-directory=ppc64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-secureplt --with-cpu=power7 --with-tune=power8
--disable-multilib --enable-multiarch --disable-werror --with-long-double-128
--enable-checking=release --build=powerpc64le-linux-gnu
--host=powerpc64le-linux-gnu --target=powerpc64le-linux-gnu
Thread model: posix
gcc version 5.2.1 20150808 (Ubuntu 5.2.1-15ubuntu1) 
COLLECT_GCC_OPTIONS='-v' '-c' '-g' '-O3' '-shared-libgcc' '-mtune=power8'
'-mcpu=power7'
 /usr/lib/gcc/powerpc64le-linux-gnu/5/cc1plus -fpreprocessed structure.ii
-msecure-plt -quiet -dumpbase structure.ii -mtune=power8 -mcpu=power7 -auxbase
structure -g -O3 -version -fstack-protector-strong -Wformat -Wformat-security
-o /tmp/ccbsT2XQ.s
GNU C++ (Ubuntu 5.2.1-15ubuntu1) version 5.2.1 20150808 (powerpc64le-linux-gnu)
compiled by GNU C version 5.2.1 20150808, GMP version 6.0.0, MPFR
version 3.1.3, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Ubuntu 5.2.1-15ubuntu1) version 5.2.1 20150808 (powerpc64le-linux-gnu)
compiled by GNU C version 5.2.1 20150808, GMP version 6.0.0, MPFR
version 3.1.3, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 01b1e70cc2d1c174675506164f1d0933
structure.ii:38:3: warning: anonymous type with no linkage used to declare
variable ' a' with linkage
 } a;
   ^
structure.ii: In function 'void Linked()':
structure.ii:42:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 305 170 306 8 (set (reg:DI 9 9)
(reg/f:DI 63 31 [orig:184 p3$_M_node ] [184])) structure.ii:20 554
{*movdi_internal64}
 (nil))
structure.ii:42:1: internal compiler error: in extract_constrain_insn, at
recog.c:2246
0x107528d3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../src/gcc/rtl-error.c:110
0x1075292b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../src/gcc/rtl-error.c:121
0x1071b7e7 extract_constrain_insn(rtx_insn*)
../../src/gcc/recog.c:2246
0x106f8527 reload_cse_simplify_operands
../../src/gcc/postreload.c:430
0x106f9983 reload_cse_simplify
../../src/gcc/postreload.c:207
0x106f9983 reload_cse_regs_1
../../src/gcc/postreload.c:246
0x106fb697 reload_cse_regs
../../src/gcc/postreload.c:94
0x106fb697 execute
../../src/gcc/postreload.c:2387
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


[Bug libstdc++/67212] New: Infinite recurtion in std::regex_match

2015-08-14 Thread antialize at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67212

Bug ID: 67212
   Summary: Infinite recurtion in std::regex_match
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: antialize at gmail dot com
  Target Milestone: ---

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

The following code, crashes for some instances of line (as given in the
attachment):

std::regex lineExp("tpie::update_fractions\\([ ]*\"([^\"]+)\"[ ]*,[ ]*([^, ]+)[
]*,[ ]*([^\\) ]+)[ ]*\\);.*", std::regex::extended);
std::string line = 
std::smatch matches;
std::regex_match(line, matches, lineExp);


The crash ocure as we are running out of stack space in some possible infinite
recurtion. The context of the code can be seen here
https://github.com/thomasmoelhave/tpie/blob/cpp11-cleanup/tpie/fractional_progress.cpp#L64

The issue is triggered by:
g++ -std=c++11 test2.cc && ./a.out


[Bug target/67002] [5] [SH]: Bootstrap stage 2/3 comparison failure - gcc/real.o differs

2015-08-14 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67002

--- Comment #27 from John Paul Adrian Glaubitz  ---
(In reply to Oleg Endo from comment #26)
> Please open a new PR if there is another boostrapping issue.

I'm afraid that might actually be the case even though I'm not sure whether
it's a bug in gcc or elsewhere.

What happens is that g++ seems to get stuck in stage3 when compiling
src/gcc/c-family/c-common.c. After a while, the build daemon will just kill g++
because of inactivity. Interestingly, c-common.o seems to compile fine though.

Should I open a new PR?

Adrian


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |5.3


[Bug libfortran/54572] Use libbacktrace library

2015-08-14 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54572

--- Comment #16 from Francois-Xavier Coudert  ---
Patch proposed: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00762.html


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||mjambor at suse dot cz

--- Comment #16 from Richard Biener  ---
The last observations also means wrong-code (latent on branches I suppose).  I
think the arg removal code (and similar) has a list of attributes it looks at
to completely disable it.  Martin?


[Bug rtl-optimization/67206] Redundant spills in simple copy loop for 32-bit x86 target

2015-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67206

--- Comment #2 from Richard Biener  ---
The memmove issue is because of

(compute_affine_dependence
  stmt_a: _16 = *_15;
  stmt_b: *_12 = _16;
) -> dependence analysis failed

  /* Now check that if there is a dependence this dependence is
 of a suitable form for memmove.  */
  vec loops = vNULL;
  ddr_p ddr;
  loops.safe_push (loop);
  ddr = initialize_data_dependence_relation (single_load, single_store,
 loops);
  compute_affine_dependence (ddr, loop);
  if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
{
  free_dependence_relation (ddr);
  loops.release ();
  return;
}

note that we don't use dependence analysis only to decide memcpy vs. memmove
(we use general alias analysis for that) but it is used to guard against
a[i+1] = a[i] which is not a memmove.  The loop in the example could be of
that form if out == in + 1.


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #17 from Marek Polacek  ---
If maybe_remove_unused_call_args is only supposed to work when we redirect to
__builtin_unreachable or __cxa_pure_virtual, maybe we should remove all
attributes except noreturn/nothrow?


[Bug tree-optimization/67213] New: When compiling for size with -Os loops can get bigger after peeling

2015-08-14 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67213

Bug ID: 67213
   Summary: When compiling for size with -Os loops can get bigger
after peeling
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fredrik.hederstie...@securitas-direct.com
  Target Milestone: ---

When compiling thumb1 code for size with -Os some loops can be larger due to
complete peeling.

Example code:

extern char data[10];

void test_iter_2(void)
{
  int i;
  for (i = 0; i < 2; i++) {
data[i] = i;
  }
}

void test_iter_6(void)
{
  int i;
  for (i = 0; i < 6; i++) {
data[i] = i;
  }
}

void test_iter_7(void)
{
  int i;
  for (i = 0; i < 7; i++) {
data[i] = i;
  }
}

It will compile to

 :
   0:   e3a02000mov r2, #0
   4:   e59f300cldr r3, [pc, #12]   ; 18 
   8:   e5c32000strbr2, [r3]
   c:   e3a02001mov r2, #1
  10:   e5c32001strbr2, [r3, #1]
  14:   e12fff1ebx  lr
  18:   .word   0x

001c :
  1c:   e3a02000mov r2, #0
  20:   e59f302cldr r3, [pc, #44]   ; 54 
  24:   e5c32000strbr2, [r3]
  28:   e3a02001mov r2, #1
  2c:   e5c32001strbr2, [r3, #1]
  30:   e3a02002mov r2, #2
  34:   e5c32002strbr2, [r3, #2]
  38:   e3a02003mov r2, #3
  3c:   e5c32003strbr2, [r3, #3]
  40:   e3a02004mov r2, #4
  44:   e5c32004strbr2, [r3, #4]
  48:   e3a02005mov r2, #5
  4c:   e5c32005strbr2, [r3, #5]
  50:   e12fff1ebx  lr
  54:   .word   0x

0058 :
  58:   e3a03000mov r3, #0
  5c:   e59f2010ldr r2, [pc, #16]   ; 74 
  60:   e7c33002strbr3, [r3, r2]
  64:   e2833001add r3, r3, #1
  68:   e3530007cmp r3, #7
  6c:   1afbbne 60 
  70:   e12fff1ebx  lr
  74:   .word   0x

The unrolling of iter_6 seems to be controlled by default:

 --param max-completely-peel-times=5

if changing to

 --param max-completely-peel-times=0

code for iter_6 gets ok, but then iter_2 get larger.

 :
   0:   e3a03000mov r3, #0
   4:   e59f2010ldr r2, [pc, #16]   ; 1c 
   8:   e7c33002strbr3, [r3, r2]
   c:   e2833001add r3, r3, #1
  10:   e3530002cmp r3, #2
  14:   1afbbne 8 
  18:   e12fff1ebx  lr
  1c:   .word   0x

0020 :
  20:   e3a03000mov r3, #0
  24:   e59f2010ldr r2, [pc, #16]   ; 3c 
  28:   e7c33002strbr3, [r3, r2]
  2c:   e2833001add r3, r3, #1
  30:   e3530006cmp r3, #6
  34:   1afbbne 28 
  38:   e12fff1ebx  lr
  3c:   .word   0x

0040 :
  40:   e3a03000mov r3, #0
  44:   e59f2010ldr r2, [pc, #16]   ; 5c 
  48:   e7c33002strbr3, [r3, r2]
  4c:   e2833001add r3, r3, #1
  50:   e3530007cmp r3, #7
  54:   1afbbne 48 
  58:   e12fff1ebx  lr
  5c:   .word   0x

I guess its a trade off between number allowed unrolls and expected code size
growth/decrease. Though it could maybe be detected that code size growth in
this case.

Attach toolchain build script and code.


[Bug tree-optimization/67213] When compiling for size with -Os loops can get bigger after peeling

2015-08-14 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67213

--- Comment #1 from Fredrik Hederstierna 
 ---
Created attachment 36185
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36185&action=edit
Example files


[Bug target/67002] [5] [SH]: Bootstrap stage 2/3 comparison failure - gcc/real.o differs

2015-08-14 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67002

--- Comment #28 from John Paul Adrian Glaubitz  ---
(In reply to John Paul Adrian Glaubitz from comment #27)
> What happens is that g++ seems to get stuck in stage3 when compiling
> src/gcc/c-family/c-common.c. After a while, the build daemon will just kill
> g++ because of inactivity. Interestingly, c-common.o seems to compile fine
> though.

Ok, it actually went further now. It was just stuck for over an hour. Looking
at strace showed that g++ was allocating memory (brk syscalls).

Will report back.


[Bug tree-optimization/67213] When compiling for size with -Os loops can get bigger after peeling

2015-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67213

--- Comment #2 from Richard Biener  ---
Btw, you can look at -fdump-tree-cunroll-details dump for why GCC thinks the
loop will get smaller in all cases.


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

Martin Jambor  changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu.org

--- Comment #18 from Martin Jambor  ---
(In reply to Richard Biener from comment #16)
> The last observations also means wrong-code (latent on branches I suppose). 
> I think the arg removal code (and similar) has a list of attributes it looks
> at to completely disable it.  Martin?

Well, IIUC, the problem here is removal of actual arguments, not
IPA-SRA (or IPA-CP) removal of formal parameters?  Neither of
those passes is involved, it's
inlining-rematerialization-cleanup-after-devirtualization thing, it
seems...


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-14
 Ever confirmed|0   |1

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

ICEs with:
g++ -c -mtune=power8 -mcpu=power7 -O3 con.ii


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

--- Comment #4 from Markus Trippelsdorf  ---
The question is if -mtune=power8 -mcpu=power7 if valid for powerpc64le.

I think the minimal CPU supported for little-endian is POWER8.


[Bug tree-optimization/67213] When compiling for size with -Os loops can get bigger after peeling

2015-08-14 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67213

--- Comment #3 from Fredrik Hederstierna 
 ---
Created attachment 36186
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36186&action=edit
Dump from tree-ssa-loop-ivcanon.c

In the function iter_6 it seems like it will keep cost 5 when unrolling.
Maybe the weights and costs estimations could be more pessimistic when
optimizing for size? I think functions tree_estimate_loop_size() and
estimated_unrolled_size() uses a rough number guess of 1/3, perhaps it could be
more pessimistic eg. for -Os?


[Bug libstdc++/67214] New: undefined behaviour in std::num_get::_M_extract_int()

2015-08-14 Thread malcolm.parsons at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67214

Bug ID: 67214
   Summary: undefined behaviour in std::num_get::_M_extract_int()
   Product: gcc
   Version: 4.8.4
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: malcolm.parsons at gmail dot com
  Target Milestone: ---

$ cat num_get.cpp 
#include 
#include 
#include 

int main()
{
std::locale loc;
auto loc1 = std::locale{loc, new boost::math::nonfinite_num_get};
std::locale::global(loc1);

std::string s{"-1"};
std::istringstream is{s};

bool v;
is >> v;
std::cout << v << '\n';
return 0;
}

$ clang++-3.6 --std=c++11 -fsanitize=undefined num_get.cpp -o num_get -O2

$ ./num_get 
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/locale_facets.tcc:468:6:
runtime error: negation of -9223372036854775808 cannot be represented in type
'long'; cast to an unsigned type to negate this value to itself

line 468 is the third line below:

  const __unsigned_type __max =
(__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
? -__gnu_cxx::__numeric_traits<_ValueT>::__min
: __gnu_cxx::__numeric_traits<_ValueT>::__max;

I'm reporting against libstdc++ 4.8.4, but these lines have not changed in git
master.


[Bug go/67198] [5/6 Regression] change of type of syscall.RawSockaddr.Data on ppc64 breaks compilation of existing programs

2015-08-14 Thread boger at us dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67198

--- Comment #6 from boger at us dot ibm.com ---
I am working with our Docker team to provide a source change that will compile
with old and new gccgo.


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #19 from Marek Polacek  ---
I'm testing

--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2949,6 +2949,8 @@ maybe_remove_unused_call_args (struct function *fn,
gimple stmt)
   && TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))) == void_type_node
   && gimple_call_num_args (stmt))
 {
+  tree fntype = gimple_call_fntype (stmt);
+  TYPE_ATTRIBUTES (fntype) = DECL_ATTRIBUTES (decl);
   gimple_set_num_ops (stmt, 3);
   update_stmt_fn (fn, stmt);
 }

instead


[Bug target/67215] New: -fno-plt needs improvements for x86

2015-08-14 Thread andrew.n.senkevich at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

Bug ID: 67215
   Summary: -fno-plt needs improvements for x86
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrew.n.senkevich at gmail dot com
CC: hjl.tools at gmail dot com
  Target Milestone: ---

We shouldn't turn

call foo@plt

into

load foo@plt into %eax
call *%eax

We should keep

call/jmp *foo@GOT


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

Martin Jambor  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #20 from Martin Jambor  ---
The problem is that when inlining transformation sets fndecl of the
call statement, it does not set the fntype (of the statement). Then
infer_nonnull_range_by_attribute comes along, looks only at the fntype
and infers that the call has more attributes than it actually has.

The following (untested) patch avoids the ICE.  Even though this issue
suggests that the type of fndecl and fntype have to be in sync, I have
vague recollections that call statement's fntype was supposed to stick
to the original type in the source somehow (though IIRC it is
primarily used for indirect calls).  In other words, I am not sure the
patch is 100% correct.  Honza, Richi, what are your opinions?


diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 22a9852..5e5b308 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1461,6 +1461,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
 {
   new_stmt = e->call_stmt;
   gimple_call_set_fndecl (new_stmt, e->callee->decl);
+  gimple_call_set_fntype (new_stmt, TREE_TYPE (e->callee->decl));
   update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), new_stet);
 }


[Bug c++/67216] New: false is still a null pointer constant

2015-08-14 Thread potswa at mac dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67216

Bug ID: 67216
   Summary: false is still a null pointer constant
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: potswa at mac dot com
  Target Milestone: ---

false should not convert to pointer types since C++11. This program is ill
formed in C++03 and well formed in C++11.

struct s {
s( long ) {}
};

struct t {
t( void * ) {}
}

void foo(s) {}
void foo(t) {}

int main() {
foo(false);
}


[Bug target/67215] -fno-plt needs improvements for x86

2015-08-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2015-08-14
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
Please provide a testcase.


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Markus Trippelsdorf  ---
Closing.
You should configure gcc --with-cpu=power8 for powerpc64le on Ubuntu.


[Bug target/67215] -fno-plt needs improvements for x86

2015-08-14 Thread andrew.n.senkevich at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

--- Comment #2 from Andrew Senkevich  ---
-bash-4.2$ cat test.c
extern int proc2(int);

int proc( void)
{
  int i = proc2( 3);

  return i;
}

gcc test.c -S -pie -fpie -o test.1.S
gcc test.c -S -pie -fpie -fno-plt -o test.2.S

-bash-4.2$ cat test.1.S
.file   "test.c"
.text
.globl  proc
.type   proc, @function
proc:
.LFB0:
.cfi_startproc
pushq   %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq%rsp, %rbp
.cfi_def_cfa_register 6
subq$16, %rsp
movl$3, %edi
callproc2@PLT
movl%eax, -4(%rbp)
movl-4(%rbp), %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size   proc, .-proc
.ident  "GCC: (GNU) 6.0.0 20150812 (experimental)"
.section.note.GNU-stack,"",@progbits

-bash-4.2$ cat test.2.S
.file   "test.c"
.text
.globl  proc
.type   proc, @function
proc:
.LFB0:
.cfi_startproc
pushq   %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq%rsp, %rbp
.cfi_def_cfa_register 6
subq$16, %rsp
movqproc2@GOTPCREL(%rip), %rax
movl$3, %edi
call*%rax
movl%eax, -4(%rbp)
movl-4(%rbp), %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size   proc, .-proc
.ident  "GCC: (GNU) 6.0.0 20150812 (experimental)"
.section.note.GNU-stack,"",@progbits


[Bug target/67215] -fno-plt needs improvements for x86

2015-08-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

--- Comment #3 from H.J. Lu  ---
(In reply to Andrew Senkevich from comment #2)
> -bash-4.2$ cat test.c
> extern int proc2(int);
> 
> int proc( void)
> {
>   int i = proc2( 3);
> 
>   return i;
> }
> 
> gcc test.c -S -pie -fpie -o test.1.S
> gcc test.c -S -pie -fpie -fno-plt -o test.2.S

Please provide a tectcase which shows the problem with -O1 and above
for both ia32 and x86-64.


[Bug c++/67216] false is still a null pointer constant

2015-08-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67216

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||accepts-invalid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-14
 Ever confirmed|0   |1


[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #21 from Richard Biener  ---
(In reply to Martin Jambor from comment #20)
> The problem is that when inlining transformation sets fndecl of the
> call statement, it does not set the fntype (of the statement). Then
> infer_nonnull_range_by_attribute comes along, looks only at the fntype
> and infers that the call has more attributes than it actually has.
> 
> The following (untested) patch avoids the ICE.  Even though this issue
> suggests that the type of fndecl and fntype have to be in sync, I have
> vague recollections that call statement's fntype was supposed to stick
> to the original type in the source somehow (though IIRC it is
> primarily used for indirect calls).  In other words, I am not sure the
> patch is 100% correct.  Honza, Richi, what are your opinions?

fntype is supposed to be the type specifying the "ABI", and yes it was
designed mainly to preserve indirect call behavior when we propagate
a (eventually "incompatible") fndecl to the call.

Iff IPA redirects a call to sth very different (like unreachable () here)
it doesn't make sense to preserve that detail.

OTOH users like infer_nonnull_range_by_attribute cannot rely on
gimple_call_fntype being "compatible" with the actual call (like in
terms of number of arguments).  So

 /* Now see if op appears in the nonnull list.  */
  for (tree t = TREE_VALUE (attrs); t; t = TREE_CHAIN (t))
{
  int idx = TREE_INT_CST_LOW (TREE_VALUE (t)) - 1;
  tree arg = gimple_call_arg (stmt, idx);

lacks a check that idx < gimple_call_num_args.

I don't think the non-null attribute is at fault here.

> 
> diff --git a/gcc/cgraph.c b/gcc/cgraph.c
> index 22a9852..5e5b308 100644
> --- a/gcc/cgraph.c
> +++ b/gcc/cgraph.c
> @@ -1461,6 +1461,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
>  {
>new_stmt = e->call_stmt;
>gimple_call_set_fndecl (new_stmt, e->callee->decl);
> +  gimple_call_set_fntype (new_stmt, TREE_TYPE (e->callee->decl));
>update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), new_stet);
>  }


[Bug tree-optimization/61441] ARM aarch64 fails to quiet signaling NaN

2015-08-14 Thread ssaraswati at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61441

--- Comment #6 from Sujoy  ---
(In reply to jos...@codesourcery.com from comment #5)

> With -fno-signaling-nans we don't really care about the result value.

I am not sure about this. -fno-signaling-nans is default and the original issue
mentions that "under default exception handling, any operation signaling an
invalid operation exception and for which a floating-point result is to be
delivered shall deliver a quiet NaN". If we have to honor the default exception
handling case, we need to convert the sNaN to qNaN here. Let me know if I
missed something.

> More precisely, exceptions are relevant with -fsignaling-nans 
> -ftrapping-math but even with -fno-trapping-math it's still visible if the 
> result is wrongly a sNaN instead of a qNaN.  (-ftrapping-math is the 
> default.  It's not clear there's any use for -fsignaling-nans 
> -fno-trapping-math.  But -fsignaling-nans is the option that says there 
> may be signaling NaN arguments, and -ftrapping-math is the option that 
> says we care about exceptions.)

The man page entry for -fno-trapping-math says 
"This option requires that -fno-signaling-nans be in effect." 

The description for -fsignaling-nans says
"This option implies -ftrapping-math."

Hence, only the following combinations should be valid -
1) -fno-trapping-math and -fno-signaling-nans
2) -ftrapping-math and -fno-signaling-nans (default)
3) -ftrapping-math and -fsignaling-nans

Here is my understanding -

For case 1, we can go ahead with optimizations that may remove operations that
may lead to exceptions, as we don't care about them. Also, we convert sNaN to
qNaN since -fno-signaling-nans is on.

For case 2, we can do the transformation like folding and they should convert
sNaN to qNaN since -fno-signaling-nans is on.

For case 3, we have to disallow certain transformation so that any operation
leading to exception due to sNaN is not optimized away.

> The *number* of exceptions isn't relevant, only the set raised at any 
> point (e.g. function call) where the raised exceptions may be tested or 
> modified; it's valid to change one nonzero number of times raising a given 
> exception between two such points to a different nonzero number of times 
> raising that exception.

Thanks for this information. Does this mean that the man page description of
-fsignaling-nans is too restrictive? 

> I'm sure there are lots of optimizations that wrongly discard exceptions, 
> whether for signaling NaNs or other operands.
> 
> Roughly, the present -ftrapping-math seems to be implemented as meaning 
> that an expression shouldn't be transformed to change the exceptions 
> raised, but exceptions aren't treated as side effects so it can still be 
> discarded if apparently unused, or moved past code that might test or 
> modify exceptions.  Something stricter that actually follows Annex F would 
> treat exceptions more like side effects and eliminate a lot of code 
> movement / dead code removal.  It might be less suitable for the default 
> compilation mode, however.
> 
> I expect there are plenty of bugs even with that more limited description 
> of what -ftrapping-math tries to do.

I was referring to the Annex F of C99 ISO IEC 9899 1999, it says -
"An operation on constants that raises no floating-point exception can be
folded during translation, except, if the state of the FENV_ACCESS pragma is
‘‘on’..."

What is the equivalent of checking FENV_ACCESS on within gcc?

As for this issue, do you think modifying gcc to handle the default case would
be the right start?

Regards,
Sujoy

[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #22 from Marek Polacek  ---
If infer_nonnull_range_by_attribute can't rely on gimple_call_fntype then we
indeed need to add a check there.

So like this?
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2694,10 +2694,13 @@ infer_nonnull_range_by_attribute (gimple stmt, tree op)
  /* Now see if op appears in the nonnull list.  */
  for (tree t = TREE_VALUE (attrs); t; t = TREE_CHAIN (t))
{
- int idx = TREE_INT_CST_LOW (TREE_VALUE (t)) - 1;
- tree arg = gimple_call_arg (stmt, idx);
- if (operand_equal_p (op, arg, 0))
-   return true;
+ unsigned int idx = TREE_INT_CST_LOW (TREE_VALUE (t)) - 1;
+ if (idx < gimple_call_num_args (stmt))
+   {
+ tree arg = gimple_call_arg (stmt, idx);
+ if (operand_equal_p (op, arg, 0))
+   return true;
+   }
}
}
 }


[Bug target/67211] [5 Regression] ICE (insn does not satisfy its constraints) on powerpc64le-linux-gnu

2015-08-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67211

Bill Schmidt  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #6 from Bill Schmidt  ---
Re-opening.  Canonical has reasons to use these particular flags for their
builds at this time.


[Bug c++/67217] New: [concepts] Constraints are ignored when specializing union templates

2015-08-14 Thread Casey at Carter dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67217

Bug ID: 67217
   Summary: [concepts] Constraints are ignored when specializing
union templates
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: Casey at Carter dot net
  Target Milestone: ---

r226833 incorrectly compiles this program without diagnostics:

template 
  requires __is_same_as(T, double)
union A {};

int main() { A{}; }

despite that int does not satisfy the constraints of A. Changing the expression
__is_same_as(T, double) to true, false, 42, or (new T) has no effect - the
program compiles without diagnostics.

Compiling *this* program, however:

template 
union B {};

template 
  requires false
union B {};

int main() {
  B{};
}

incorrectly produces diagnostics:

~/gcc6-r226833/bin/g++ -std=gnu++1z foo.cpp -c
foo.cpp: In function ‘int main()’:
foo.cpp:9:10: error: ambiguous template instantiation for ‘union B’
   B{};
  ^
foo.cpp:6:7: note: candidates are: template union B [with T = int]
 union B {};
   ^
foo.cpp:6:12: note: template union B [with T = int]
 union B {};
^
foo.cpp:6:13: note: template union B [with T = int]
 union B {};
 ^
foo.cpp:9:10: error: invalid use of incomplete type ‘union B’
   B{};
  ^
foo.cpp:2:7: note: declaration of ‘union B’
 union B {};
   ^

It would appear that constraints are not being checked on union templates.

[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #23 from Manuel López-Ibáñez  ---
(In reply to Richard Biener from comment #21)
> OTOH users like infer_nonnull_range_by_attribute cannot rely on
> gimple_call_fntype being "compatible" with the actual call (like in
> terms of number of arguments).  So
> 
> lacks a check that idx < gimple_call_num_args.

And what would happen if the nonnull attribute refers to a different argument
that still satisfies the check? For example, fntype may have more arguments
than the call and the one marked as nonnull may still satisfy the check, yet
not be the actual argument that was marked as nonnull.

There must be a way to "fix" the attributes or mark them as not "compatible".
Asking "users" of the attributes to "guess" if the attributes are compatible
seems fragile.

[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #24 from Marek Polacek  ---
(In reply to Manuel López-Ibáñez from comment #23)

> And what would happen if the nonnull attribute refers to a different
> argument that still satisfies the check? For example, fntype may have more
> arguments than the call and the one marked as nonnull may still satisfy the
> check, yet not be the actual argument that was marked as nonnull.

Then operand_equal_p would return false.

[Bug libfortran/48664] Use autoconf test instead of target blacklist to determine weak undefined reference support

2015-08-14 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48664

Francois-Xavier Coudert  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-08-14
 CC||fxcoudert at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |fxcoudert at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Francois-Xavier Coudert  ---
Patch available: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00796.html


[Bug target/67143] [5/6 Regression] ICE (could not split insn) on aarch64-linux-gnu

2015-08-14 Thread mwahab at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67143

--- Comment #3 from mwahab at gcc dot gnu.org ---
Author: mwahab
Date: Fri Aug 14 15:05:42 2015
New Revision: 226895

URL: https://gcc.gnu.org/viewcvs?rev=226895&root=gcc&view=rev
Log:
gcc/
2015-08-14  Matthew Wahab  

PR target/67143
* config/aarch64/atomics.md (atomic_): Replace
'lconst_atomic' with 'const_atomic'.
(atomic_fetch_): Likewise.
(atomic__fetch): Likewise.
* config/aarch64/iterators.md (lconst-atomic): Move below
'const_atomic'.
(const_atomic): New.

gcc/testsuite/
2015-08-14  Matthew Wahab  
Matthias Klose  

PR target/67143
* gcc.c-torture/compile/pr67143.c: New
* gcc.target/aarch64/atomic-op-imm.c
(atomic_fetch_add_negative_RELAXED): New.
(atomic_fetch_sub_negative_ACQUIRE): New.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr67143.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/atomics.md
trunk/gcc/config/aarch64/iterators.md
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c


[Bug target/37845] gcc ignores FP_CONTRACT pragma set to OFF

2015-08-14 Thread vincent-gcc at vinc17 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37845

Vincent Lefèvre  changed:

   What|Removed |Added

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

--- Comment #6 from Vincent Lefèvre  ---
This bug has been fixed by:

r204460 | jsm28 | 2013-11-06 17:52:47 +0100 (Wed, 06 Nov 2013) | 9 lines
Changed paths:
   M /trunk/gcc/c-family/ChangeLog
   M /trunk/gcc/c-family/c-cppbuiltin.c
   M /trunk/gcc/c-family/c-opts.c
   M /trunk/gcc/testsuite/ChangeLog
   A /trunk/gcc/testsuite/gcc.dg/torture/c99-contract-1.c

c-family:
* c-opts.c (c_common_post_options): Set -ffp-contract=off in C
standards modes.
* c-cppbuiltin.c (cpp_iec_559_value): Consider -ffp-contract=fast
to mean lack of IEEE 754 support.

testsuite:
* gcc.dg/torture/c99-contract-1.c: New test.

gcc/c-family/c-opts.c now contains:

  /* ISO C restricts floating-point expression contraction to within
 source-language expressions (-ffp-contract=on, currently an alias
 for -ffp-contract=off).  */
  if (flag_iso
  && !c_dialect_cxx ()
  && (global_options_set.x_flag_fp_contract_mode
  == (enum fp_contract_mode) 0)
  && flag_unsafe_math_optimizations == 0)
flag_fp_contract_mode = FP_CONTRACT_OFF;

I tested, and this works as expected.

Note: This bug was about FP contraction being done despite the use of:
#pragma STDC FP_CONTRACT OFF
not about the pragma being ignored (the implementation of this pragma is not
required by the ISO C standard if the default is OFF, which is now the case
with GCC). So, this bug is really fixed. A new enhancement bug could be opened
(if not already done) for the implementation of the STDC FP_CONTRACT pragma.

[Bug rtl-optimization/67218] New: Combine incorrectly folds (double) (float) (unsigned)

2015-08-14 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67218

Bug ID: 67218
   Summary: Combine incorrectly folds (double) (float) (unsigned)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

simplify-rtx.c folds (double) (float) (some-int) into
(double) (some-int) if it can prove that the intermediate
(float) doesn't have any effect.  This check is based on
the number of known "sign bit copies", which inherently assumes
a signed interpretation of (some-int) and is therefore only
valid for FLOAT.  For UNSIGNED_FLOAT we can end up treating a
large unsigned value as fitting in a float.

The following test case fails at -O and above on aarch64-linux-gnu
because of this:

extern void abort (void) __attribute__ ((noreturn));

double __attribute__ ((noinline, noclone))
foo (unsigned int x)
{
  return (double) (float) (x | 0x);
}

int
main ()
{
  if (foo (1) != 0x1.fffep31)
abort ();
  return 0;
}


[Bug rtl-optimization/67218] Combine incorrectly folds (double) (float) (unsigned)

2015-08-14 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67218

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-08-14
   Assignee|unassigned at gcc dot gnu.org  |rsandifo at gcc dot 
gnu.org
 Ever confirmed|0   |1


[Bug target/67215] -fno-plt needs improvements for x86

2015-08-14 Thread andrew.n.senkevich at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

--- Comment #4 from Andrew Senkevich  ---
-bash-4.2$ cat test.c
extern char* mem(int);
char* arr[32];

void proc(void)
{
  int i;

  for (i=0;i<32;i++)
arr[i] = mem(128);
}

gcc -pie -fpie -fno-plt -O2  -S test.c -o test_32.S -m32
gcc -pie -fpie -fno-plt -O2  -S test.c -o test_64.S

-bash-4.2$ cat test_32.S
. . .
proc:
.LFB0:
.cfi_startproc
call__x86.get_pc_thunk.ax
addl$_GLOBAL_OFFSET_TABLE_, %eax
pushl   %edi
.cfi_def_cfa_offset 8
.cfi_offset 7, -8
pushl   %esi
.cfi_def_cfa_offset 12
.cfi_offset 6, -12
pushl   %ebx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
movlarr@GOT(%eax), %ebx
movlmem@GOT(%eax), %esi
leal128(%ebx), %edi
.p2align 4,,10
.p2align 3
.L2:
subl$12, %esp
.cfi_def_cfa_offset 28
addl$4, %ebx
pushl   $128
.cfi_def_cfa_offset 32
call*%esi
movl%eax, -4(%ebx)
addl$16, %esp
.cfi_def_cfa_offset 16
cmpl%edi, %ebx
jne .L2
popl%ebx
.cfi_restore 3
.cfi_def_cfa_offset 12
popl%esi
.cfi_restore 6
.cfi_def_cfa_offset 8
popl%edi
.cfi_restore 7
.cfi_def_cfa_offset 4
ret
.cfi_endproc
.LFE0:
.size   proc, .-proc
. . .

-bash-4.2$ cat test_64.S
. . .
proc:
.LFB0:
.cfi_startproc
pushq   %r12
.cfi_def_cfa_offset 16
.cfi_offset 12, -16
pushq   %rbp
.cfi_def_cfa_offset 24
.cfi_offset 6, -24
pushq   %rbx
.cfi_def_cfa_offset 32
.cfi_offset 3, -32
movqarr@GOTPCREL(%rip), %rbx
movqmem@GOTPCREL(%rip), %rbp
leaq256(%rbx), %r12
.p2align 4,,10
.p2align 3
.L2:
movl$128, %edi
addq$8, %rbx
call*%rbp
movq%rax, -8(%rbx)
cmpq%r12, %rbx
jne .L2
popq%rbx
.cfi_def_cfa_offset 24
popq%rbp
.cfi_def_cfa_offset 16
popq%r12
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE0:
.size   proc, .-proc
. . .


[Bug target/67215] -fno-plt needs improvements for x86

2015-08-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||izamyatin at gmail dot com,
   ||kirill.yukhin at intel dot com


[Bug fortran/67219] New: [6 Regression] Incorrect conversion warning

2015-08-14 Thread Joost.VandeVondele at mat dot ethz.ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67219

Bug ID: 67219
   Summary: [6 Regression] Incorrect conversion warning
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: Joost.VandeVondele at mat dot ethz.ch
  Target Milestone: ---

The following testcase leads to an incorrect conversion warning (and a failed
CP2K build) with gcc 6.0, while 5.1 compiles fine

> cat bug.f90
MODULE kinds
  IMPLICIT NONE
  INTEGER, PARAMETER :: int_4 = SELECTED_INT_KIND(5)
  INTEGER, PARAMETER :: int_8 = SELECTED_INT_KIND(10)
  INTEGER, PARAMETER :: valt = int_8
END MODULE
MODULE foo
  USE kinds
  IMPLICIT NONE
CONTAINS
  ELEMENTAL FUNCTION kg_get_value(dsat, degree) RESULT(value)
INTEGER, INTENT(IN)  :: dsat, degree
INTEGER(KIND=valt)   :: value
INTEGER, PARAMETER   :: huge_4 = HUGE(0_int_4)
value = (huge_4 - INT(dsat,KIND=int_8)) * huge_4 + huge_4-degree
  END FUNCTION
END MODULE

> gfortran -c -Wconversion -Werror bug.f90
bug.f90:14:56:

 INTEGER, PARAMETER   :: huge_4 = HUGE(0_int_4)
1
Error: Change of value in conversion from ‘INTEGER(4)’ to ‘REAL(4)’ at (1)
[-Werror=conversion]
f951: all warnings being treated as errors

There are no REAL(4) in this statement, AFAICT.

[Bug tree-optimization/61441] ARM aarch64 fails to quiet signaling NaN

2015-08-14 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61441

--- Comment #7 from joseph at codesourcery dot com  ---
On Fri, 14 Aug 2015, ssaraswati at gmail dot com wrote:

> --- Comment #6 from Sujoy  ---
> (In reply to jos...@codesourcery.com from comment #5)
> 
> > With -fno-signaling-nans we don't really care about the result value.
> 
> I am not sure about this. -fno-signaling-nans is default and the original 
> issue
> mentions that "under default exception handling, any operation signaling an
> invalid operation exception and for which a floating-point result is to be
> delivered shall deliver a quiet NaN". If we have to honor the default 
> exception
> handling case, we need to convert the sNaN to qNaN here. Let me know if I
> missed something.

With -fno-signaling-nans, signaling NaN representations are trap 
representations - the compiler can assume that nothing ever manipulated as 
a floating-point value has such a representation.  (It cannot assume 
anything about unions of floating-point and other types where the 
floating-point field is not accessed.  But 58416 is a bug even in the 
absence of -fsignaling-nans.)

> 1) -fno-trapping-math and -fno-signaling-nans
> 2) -ftrapping-math and -fno-signaling-nans (default)
> 3) -ftrapping-math and -fsignaling-nans
> 
> Here is my understanding -
> 
> For case 1, we can go ahead with optimizations that may remove operations that
> may lead to exceptions, as we don't care about them. Also, we convert sNaN to
> qNaN since -fno-signaling-nans is on.
> 
> For case 2, we can do the transformation like folding and they should convert
> sNaN to qNaN since -fno-signaling-nans is on.

In both these cases, we formally don't care about the result (but if 
folding, it still would seem odd to fold incorrectly, so may as well fold 
to a qNaN).

> > The *number* of exceptions isn't relevant, only the set raised at any 
> > point (e.g. function call) where the raised exceptions may be tested or 
> > modified; it's valid to change one nonzero number of times raising a given 
> > exception between two such points to a different nonzero number of times 
> > raising that exception.
> 
> Thanks for this information. Does this mean that the man page description of
> -fsignaling-nans is too restrictive? 

This point is nothing to do with -fsignaling-nans.  It's a simple matter 
of C11 F.9.1 paragraph 3, "This specification does not require support for 
trap handlers that maintain information about the order or count of 
floating-point exceptions" (which TS 18661-1:2014, adding support for 
signaling NaNs, doesn't change).  But it's true that any references to a 
number of exceptions should make clear it's only referring to the 
distinction between zero and nonzero numbers.

> I was referring to the Annex F of C99 ISO IEC 9899 1999, it says -
> "An operation on constants that raises no floating-point exception can be
> folded during translation, except, if the state of the FENV_ACCESS pragma is
> ‘‘on’..."
> 
> What is the equivalent of checking FENV_ACCESS on within gcc?

-ftrapping-math -frounding-math (but as I noted, -ftrapping-math doesn't 
really cover everything it should for that purpose, and something that did 
might not be suitable for enabling by default).

> As for this issue, do you think modifying gcc to handle the default case would
> be the right start?

Local fixes for particular signaling NaNs issues seem reasonable (as in: 
if you fold an operation involving a signaling NaN, you may as well quiet 
it in the process, even though signaling NaNs aren't meant to occur in any 
mode where folding them is likely to be safe).

[Bug middle-end/67133] [6 Regression] ICE at -Os and above on x86_64-linux-gnu in gimple_op, at gimple.h:2274

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133

--- Comment #25 from Marek Polacek  ---
Author: mpolacek
Date: Fri Aug 14 16:29:38 2015
New Revision: 226896

URL: https://gcc.gnu.org/viewcvs?rev=226896&root=gcc&view=rev
Log:
PR middle-end/67133
* gimple.c (infer_nonnull_range_by_attribute): Check that the
nonnull argument position is not outside function arguments.

* gcc.dg/torture/pr67133.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr67133.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/66857] [5/6 Regression] Reference not bound to lvalue

2015-08-14 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66857

--- Comment #7 from Jason Merrill  ---
Author: jason
Date: Fri Aug 14 16:33:10 2015
New Revision: 226897

URL: https://gcc.gnu.org/viewcvs?rev=226897&root=gcc&view=rev
Log:
Fix PR c++/66857

gcc/cp/ChangeLog:

PR c++/66857
* cvt.c (ocp_convert): Don't call scalar_constant_value when
converting to a class type.

gcc/testsuite/ChangeLog:

PR c++/66857
* g++.dg/init/pr66857.C: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/init/pr66857.C
Modified:
branches/gcc-5-branch/gcc/cp/ChangeLog
branches/gcc-5-branch/gcc/cp/cvt.c


[Bug c++/66857] [5/6 Regression] Reference not bound to lvalue

2015-08-14 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66857

Jason Merrill  changed:

   What|Removed |Added

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

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


[Bug fortran/67219] [6 Regression] Incorrect conversion warning

2015-08-14 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67219

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-14
 CC||kargl at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from kargl at gcc dot gnu.org ---
This is a really weird bug.

This reduced test produces the error:

function foo(bar)
   integer(8) :: foo
   integer(4), intent(in) :: bar
   integer(4), parameter  :: huge_4 = huge(0_4)
   foo = (huge_4 - int(bar,kind=8))
end function

This reduced test does not produce the error:

function foo(bar)
   integer(8) :: foo
   integer(4), intent(in) :: bar
   integer(4), parameter  :: huge_4 = huge(0_4)
   foo = huge_4 - int(bar,kind=8)
end function


The only difference is the outer ( ) in the assignment
to foo.


[Bug libstdc++/61582] C++11 regex memory corruption

2015-08-14 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61582

Tim Shen  changed:

   What|Removed |Added

 CC||morandidodo at gmail dot com

--- Comment #15 from Tim Shen  ---
*** Bug 66456 has been marked as a duplicate of this bug. ***


[Bug libstdc++/66456] regex memory corruption on large input strings

2015-08-14 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66456

Tim Shen  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Tim Shen  ---
Mark as duplicate to 61582 which is also about stack overflow.

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


[Bug libstdc++/67212] Infinite recurtion in std::regex_match

2015-08-14 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67212

Tim Shen  changed:

   What|Removed |Added

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

--- Comment #1 from Tim Shen  ---
Mark as duplicate, since it's as well about stack overflow.

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


[Bug libstdc++/61582] C++11 regex memory corruption

2015-08-14 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61582

Tim Shen  changed:

   What|Removed |Added

 CC||antialize at gmail dot com

--- Comment #16 from Tim Shen  ---
*** Bug 67212 has been marked as a duplicate of this bug. ***


[Bug libstdc++/67212] Infinite recurtion in std::regex_match

2015-08-14 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67212

--- Comment #2 from Tim Shen  ---
This isn't an "infinite" recursion, but just a deep one. I haven't implement
heap allocation and manual recursion yet. In the mean time, you may compile
your code with -O2 (tail recursion elimination may help), set a larger stack
size, or use -fsplit-stack.


[Bug middle-end/67220] New: GCC fails to properly handle libcall symbol visibility of built functions

2015-08-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220

Bug ID: 67220
   Summary: GCC fails to properly handle libcall symbol visibility
of built functions
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

[hjl@gnu-6 builtins-2]$ cat x.c
typedef __SIZE_TYPE__ size_t;
extern void *memset(void *s, int c, size_t n)
  __attribute__ ((visibility ("hidden")));

void
foo1 (void *s, size_t n)
{
  memset (s, '\0', n);
}

void
foo2 (void *s, int c, size_t n)
{
  memset (s, c, n);
}
[hjl@gnu-6 builtins-2]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -fPIC  -S -o x.s x.c
[hjl@gnu-6 builtins-2]$ cat x.s
.file   "x.c"
.section.text.unlikely,"ax",@progbits
.LCOLDB0:
.text
.LHOTB0:
.p2align 4,,15
.globl  foo1
.type   foo1, @function
foo1:
.LFB0:
.cfi_startproc
movq%rsi, %rdx
xorl%esi, %esi
jmp memset@PLT  <<  It shouldn't use PLT.
.cfi_endproc
.LFE0:
.size   foo1, .-foo1
.section.text.unlikely
.LCOLDE0:
.text
.LHOTE0:
.section.text.unlikely
.LCOLDB1:
.text
.LHOTB1:
.p2align 4,,15
.globl  foo2
.type   foo2, @function
foo2:
.LFB1:
.cfi_startproc
jmp memset
.cfi_endproc
.LFE1:
.size   foo2, .-foo2
.section.text.unlikely
.LCOLDE1:
.text
.LHOTE1:
.hidden memset
.ident  "GCC: (GNU) 6.0.0 20150812 (experimental)"
.section.note.GNU-stack,"",@progbits
[hjl@gnu-6 builtins-2]$


[Bug rtl-optimization/67221] New: ICE at -Os and above on x86_64-linux-gnu: Segmentation fault (program cc1)

2015-08-14 Thread su at cs dot ucdavis.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67221

Bug ID: 67221
   Summary: ICE at -Os and above on x86_64-linux-gnu: Segmentation
fault (program cc1)
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following (valid) code causes an ICE when compiled with the current gcc
trunk at -Os and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It is a regression from 5.1.x. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20150813 (experimental) [trunk revision 226872] (GCC) 
$ 
$ gcc-trunk -O1 -c small.c
$ gcc-5.1 -Os -c small.c
$ 
$ gcc-trunk -Os -c small.c
gcc-trunk: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
$ 


--


int a, b;

int
fn1 (int p)
{
  return 0 == 0 ? p : 0;
}

void
fn2 ()
{
  int c = 1, d[1] = { 1 };
lbl:
  for (;;)
{
  int e;
  c ? 0 : 0 / c;
  c = 0;
  if (fn1 (d[0]))
break;
  for (e = 0; e < 1; e++)
for (c = 1; b;)
  {
if (a)
  break;
goto lbl;
  }
}
}


[Bug rtl-optimization/67221] ICE at -Os and above on x86_64-linux-gnu: Segmentation fault (program cc1)

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67221

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-14
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.


[Bug rtl-optimization/67221] ICE at -Os and above on x86_64-linux-gnu: Segmentation fault (program cc1)

2015-08-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67221

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #2 from Markus Trippelsdorf  ---
Looks like a stack overflow in gimple-match.c.


[Bug middle-end/67034] [6 Regression] FAIL: gcc.c-torture/compile/pr39928-1.c

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67034

--- Comment #5 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and conte

[Bug rtl-optimization/67000] [6 Regression] ICE in split_complex_args, at function.c:2325 on ppc64le

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67000

--- Comment #5 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and conte

[Bug middle-end/66983] [6 Regression] Many testsuite regressions

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66983

--- Comment #2 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and conte

[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164

--- Comment #50 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and cont

[Bug middle-end/67035] [6 Regression] FAIL: gcc.c-torture/compile/pr54713-3.c

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67035

--- Comment #2 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and conte

[Bug bootstrap/66978] [6 Regression] bootstrap failure with --with-multilib-list=m32,m64,mx32

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66978

--- Comment #7 from Alexandre Oliva  ---
Author: aoliva
Date: Fri Aug 14 18:51:50 2015
New Revision: 226901

URL: https://gcc.gnu.org/viewcvs?rev=226901&root=gcc&view=rev
Log:
[PR64164] Drop copyrename, use coalescible partition as base when optimizing.

for  gcc/ChangeLog

PR rtl-optimization/64164
PR bootstrap/66978
PR middle-end/66983
PR rtl-optimization/67000
PR middle-end/67034
PR middle-end/67035
* Makefile.in (OBJS): Drop tree-ssa-copyrename.o.
* tree-ssa-copyrename.c: Removed.
* opts.c (default_options_table): Drop -ftree-copyrename.  Add
-ftree-coalesce-vars.
* passes.def: Drop all occurrences of pass_rename_ssa_copies.
* common.opt (ftree-copyrename): Ignore.
(ftree-coalesce-inlined-vars): Likewise.
* doc/invoke.texi: Remove the ignored options above.
* gimple-expr.h (gimple_can_coalesce_p): Move declaration
* tree-ssa-coalesce.h: ... here.
* tree-ssa-uncprop.c: Include tree-ssa-coalesce.h and other
headers required by it.
* gimple-expr.c (gimple_can_coalesce_p): Allow coalescing
across variables when flag_tree_coalesce_vars.  Check register
use and promoted modes to allow coalescing.  Do not coalesce
maybe-byref parms with SSA_NAMEs of other variables, or
anonymous SSA_NAMEs.  Moved to tree-ssa-coalesce.c.
* tree-ssa-live.c (struct tree_int_map_hasher): Move along
with its member functions to tree-ssa-coalesce.c.
(var_map_base_init): Likewise.  Renamed to
compute_samebase_partition_bases.
(partition_view_normal): Drop want_bases parameter.
(partition_view_bitmap): Likewise.
* tree-ssa-live.h: Adjust declarations.
* tree-ssa-coalesce.c: Include explow.h and cfgexpand.h.
(build_ssa_conflict_graph): Process PARM_ and RESULT_DECLs's
default defs at the entry point.
(dump_part_var_map): New.
(compute_optimized_partition_bases): New, called by...
(coalesce_ssa_name): ... when flag_tree_coalesce_vars, instead
of compute_samebase_partition_bases.  Adjust.
* alias.c (nonoverlapping_memrefs_p): Disregard gimple-regs.
* cfgexpand.c (leader_merge, parm_maybe_byref_p): New.
(ssa_default_def_partition): New.
(get_rtl_for_parm_ssa_default_def): New.
(align_local_variable, add_stack_var): Support anonymous SSA
names.
(defer_stack_allocation): Likewise.  Declare earlier.
(set_rtl): Merge exprs and attrs, even for MEMs and non-SSA
vars.  Update DECL_RTL for PARM_DECLs and RESULT_DECLs too.
Do no record deferred-allocation marker in
SA.partition_to_pseudo.
(expand_stack_vars): Adjust check for the marker in it.
(expand_one_stack_var_at): Handle anonymous SSA_NAMEs.  Drop
redundant MEM attr setting.
(expand_one_stack_var_1): Handle anonymous SSA_NAMEs.  Renamed
from...
(expand_one_stack_var): ... this.  New wrapper to check and
skip already expanded SSA partitions.
(record_alignment_for_reg_var): New, factored out of...
(expand_one_var): ... this.
(expand_one_ssa_partition): New.
(adjust_one_expanded_partition_var): New.
(expand_one_register_var): Check and skip already expanded SSA
partitions.
(expand_used_vars): Don't create DECLs for anonymous SSA
names.  Expand all SSA partitions, then adjust all SSA names.
(pass::execute): Replace the loops that set
SA.partition_to_pseudo from partition leaders and cleared
DECL_RTL for multi-location variables, and that which used to
rename vars and set attrs, with one that clears DECL_RTL and
checks that PARMs and RESULTs default_defs match DECL_RTL.
* cfgexpand.h (get_rtl_for_parm_ssa_default_def): Declare.
* emit-rtl.c: Include stor-layout.h.
(set_reg_attrs_for_parm): Handle NULL decl.
(set_reg_attrs_for_decl_rtl): Take mode from expression if
it's not a DECL.
* stmt.c (emit_case_decision_tree): Pass it the SSA_NAME
rather than its possibly-NULL DECL.
* explow.c (promote_ssa_mode): New.
* explow.h (promote_ssa_mode): Declare.
* expr.c (expand_expr_real_1): Handle anonymous SSA_NAMEs.
(read_complex_part): Export.
* expr.h (read_complex_part): Declare.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* function.c: Include cfgexpand.h.
(use_register_for_decl): Handle SSA_NAMEs, anonymous or not.
(use_register_for_parm_decl): Wrapper for the above to
special-case the result_ptr.
(rtl_for_parm): Ditto for get_rtl_for_parm_ssa_default_def.
(split_complex_args): Take assign_parm_data_all argument.
Pass it to rtl_for_parm.  Set up rtl and conte

[Bug c++/67216] false is still a null pointer constant

2015-08-14 Thread pravasimeet999 at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67216

Pravasi Meet  changed:

   What|Removed |Added

 CC||pravasimeet999 at yahoo dot com

--- Comment #1 from Pravasi Meet  ---
This bug came into observation by the question that was asked on StackOverflow
user Pravasi Meet. See this
http://stackoverflow.com/questions/32009694/why-implicit-conversion-of-bool-to-string-isnt-an-error/32009989?noredirect=1#comment51927225_32009989
link.


[Bug middle-end/67220] GCC fails to properly handle libcall symbol visibility of built functions

2015-08-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-14
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
Inside the same function, one memset is called via PLT and the other
isn't:

[hjl@gnu-6 pr67220]$ cat y.c
typedef __SIZE_TYPE__ size_t;
extern void *memset(void *s, int c, size_t n)
  __attribute__ ((visibility ("hidden")));

extern void bar (void *s);

int
foo2 (void *s, int c, size_t n)
{
  memset (s, '\0', n);
  bar (s);
  memset (s, c, n);
  return 0;
}
[hjl@gnu-6 pr67220]$ make y.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -fPIC  -S -o y.s y.c
[hjl@gnu-6 pr67220]$ cat y.s
.file   "y.c"
.section.text.unlikely,"ax",@progbits
.LCOLDB0:
.text
.LHOTB0:
.p2align 4,,15
.globl  foo2
.type   foo2, @function
foo2:
.LFB0:
.cfi_startproc
pushq   %r12
.cfi_def_cfa_offset 16
.cfi_offset 12, -16
pushq   %rbp
.cfi_def_cfa_offset 24
.cfi_offset 6, -24
movl%esi, %r12d
pushq   %rbx
.cfi_def_cfa_offset 32
.cfi_offset 3, -32
xorl%esi, %esi
movq%rdi, %rbx
movq%rdx, %rbp
callmemset@PLT   via PLT
movq%rbx, %rdi
callbar@PLT
movq%rbp, %rdx
movl%r12d, %esi
movq%rbx, %rdi
callmemset  No PLT
popq%rbx
.cfi_def_cfa_offset 24
xorl%eax, %eax
popq%rbp
.cfi_def_cfa_offset 16
popq%r12
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE0:
.size   foo2, .-foo2
.section.text.unlikely
.LCOLDE0:
.text
.LHOTE0:
.hidden memset
.ident  "GCC: (GNU) 6.0.0 20150812 (experimental)"
.section.note.GNU-stack,"",@progbits
[hjl@gnu-6 pr67220]$


[Bug rtl-optimization/67221] ICE at -Os and above on x86_64-linux-gnu: Segmentation fault (program cc1)

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67221

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


[Bug middle-end/67222] [4.9/5/6 Regression] ICE in gimple_call_arg with bogus posix_memalign

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67222

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |4.9.4
Summary|ICE in gimple_call_arg with |[4.9/5/6 Regression] ICE in
   |bogus posix_memalign|gimple_call_arg with bogus
   ||posix_memalign


[Bug middle-end/67222] New: ICE in gimple_call_arg with bogus posix_memalign

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67222

Bug ID: 67222
   Summary: ICE in gimple_call_arg with bogus posix_memalign
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

int
main (void)
{
  posix_memalign ();
}

$ ./cc1 -quiet -O k.c
k.c: In function ‘main’:
k.c:4:3: warning: implicit declaration of function ‘posix_memalign’
[-Wimplicit-function-declaration]
   posix_memalign ();
   ^
k.c:2:1: internal compiler error: in gimple_call_arg, at gimple.h:3099
 main (void)
 ^
0x159df7d gimple_call_arg
/home/marek/src/gcc/gcc/gimple.h:3099
0x159dfd3 gimple_call_arg
/home/marek/src/gcc/gcc/gimple.h:3107
0x159fa88 lower_builtin_posix_memalign
/home/marek/src/gcc/gcc/gimple-low.c:819
0x159eccb lower_stmt
/home/marek/src/gcc/gcc/gimple-low.c:351
0x159e8f6 lower_sequence
/home/marek/src/gcc/gcc/gimple-low.c:212
0x159ef78 lower_gimple_bind
/home/marek/src/gcc/gcc/gimple-low.c:426
0x159e9f8 lower_stmt
/home/marek/src/gcc/gcc/gimple-low.c:250
0x159e8f6 lower_sequence
/home/marek/src/gcc/gcc/gimple-low.c:212
0x159ef78 lower_gimple_bind
/home/marek/src/gcc/gcc/gimple-low.c:426
0x159e593 lower_function_body
/home/marek/src/gcc/gcc/gimple-low.c:116
0x159e85a execute
/home/marek/src/gcc/gcc/gimple-low.c:190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug middle-end/67222] [4.9/5/6 Regression] ICE in gimple_call_arg with bogus posix_memalign

2015-08-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67222

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-08-14
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
I'll take a look next week.


[Bug c/67223] New: Address misaligned for ldrexd

2015-08-14 Thread soldier.kam at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67223

Bug ID: 67223
   Summary: Address misaligned for ldrexd
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: soldier.kam at gmail dot com
  Target Milestone: ---

Hi!
I compiled wrk (https://github.com/wg/wrk) for odroid-c1. Binary runs but cause
bus error. I thought that it is caused by ldrexd that requires address to be
doubleword aligned but it is not - it is 0xb5c3103c. See below for details.

In dmesg I found: 
"Alignment trap: wrk (19927) PC=0x00017494 Instr=0xe1b14f9f Address=0xb5c3212c
FSR 0x001"

GDBs "show registers":
r0 0x1e8481 201
r1 0xb5c3103c   3049459772
r2 0x1  1
r3 0x0  0
r4 0x16378  91000
r5 0xbefffa08   3204446728
r6 0x0  0
r7 0x152338
r8 0xbefffa08   3204446728
r9 0x0  0
r100xb6ff94c0   3070203072
r110xb0f85cfc   2969066748
r120xb5c3000c   3049455628
sp 0xb0f85cd0   0xb0f85cd0
lr 0x15fcc  90060
pc 0x17494  0x17494 
cpsr   0x200b0010   537591824

Assembler for this function:
00017440 :
   17440:   e92d4830push{r4, r5, fp, lr}
   17444:   e28db00cadd fp, sp, #12
   17448:   e24dd020sub sp, sp, #32
   1744c:   e50b0020str r0, [fp, #-32]  ; 0xffe0
   17450:   e14b22fcstrdr2, [fp, #-44]  ; 0xffd4
   17454:   e51b3020ldr r3, [fp, #-32]  ; 0xffe0
   17458:   e1c300d8ldrdr0, [r3, #8]
   1745c:   e14b22dcldrdr2, [fp, #-44]  ; 0xffd4
   17460:   e1510003cmp r1, r3
   17464:   0152cmpeq   r0, r2
   17468:   8a01bhi 17474 
   1746c:   e3a03000mov r3, #0
   17470:   ea48b   17598 
   17474:   e51b302cldr r3, [fp, #-44]  ; 0xffd4
   17478:   e2833004add r3, r3, #4
   1747c:   e1a03183lsl r3, r3, #3
   17480:   e51b2020ldr r2, [fp, #-32]  ; 0xffe0
   17484:   e0821003add r1, r2, r3
   17488:   e3a02001mov r2, #1
   1748c:   e3a03000mov r3, #0
   17490:   f57ff05fdmb sy
   17494:   e1b14f9fldrexd  r4, [r1]
   17498:   e0944002addsr4, r4, r2
   1749c:   e0a55003adc r5, r5, r3
   174a0:   e1a10f94strexd  r0, r4, [r1]
   174a4:   e350cmp r0, #0
   174a8:   1af9bne 17494 
   174ac:   f57ff05fdmb sy
   174b0:   e51b1020ldr r1, [fp, #-32]  ; 0xffe0
   174b4:   e3a02001mov r2, #1
   174b8:   e3a03000mov r3, #0
   174bc:   f57ff05fdmb sy
   174c0:   e1b14f9fldrexd  r4, [r1]
   174c4:   e0944002addsr4, r4, r2
   174c8:   e0a55003adc r5, r5, r3
   174cc:   e1a10f94strexd  r0, r4, [r1]
   174d0:   e350cmp r0, #0
   174d4:   1af9bne 174c0 
   ...

Output "gcc -v":
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/5.2.0/lto-wrapper
Target: armv7l-unknown-linux-gnueabihf
Configured with: /build/gcc/src/gcc-5.2.0/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib
--disable-werror --enable-checking=release
--with-default-libstdcxx-abi=gcc4-compatible
--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf
--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16
Thread model: posix
gcc version 5.2.0 (GCC)


[Bug c/67224] New: UTF-8 support for identifier names in GCC

2015-08-14 Thread ejolson at unr dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67224

Bug ID: 67224
   Summary: UTF-8 support for identifier names in GCC
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ejolson at unr dot edu
  Target Milestone: ---

Created attachment 36187
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36187&action=edit
One line patch to add C99 UTF-8 support in identifiers to gcc

In response to FAQ

> What is the status of adding the UTF-8 support for identifier names in GCC?

and the request

> Support for actual UTF-8 in identifiers is still pending (please contribute!)

my observation is that UTF-8 in identifiers is easy to add to gcc by changing
one line in the cpp preprocessor, provided a recent version of iconv is
installed on the system.  The patch is attached and has been tested for about 6
months.  More information about this patch as well as unrelated information
about getting cilkrts to work on ARM is available at 

  https://www.raspberrypi.org/forums/viewtopic.php?p=802657


[Bug c/67224] UTF-8 support for identifier names in GCC

2015-08-14 Thread ejolson at unr dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67224

--- Comment #1 from Eric  ---
To check the installed version of iconv has C99 support type

  $ iconv --list | grep "C99"
  C99
  $

which means that iconv is recent enough.


[Bug c/66326] Floating point exception with -mfpmath=387 and -fcilkplus.

2015-08-14 Thread ejolson at unr dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66326

--- Comment #3 from Eric  ---
GCC version 5.2 has come around and the bug is still here.

In particular, compiling for 32-bit Intel or using -mfpmath=387 in 64-bit leads
to immediate floating point exceptions.  The fix was to comment out the define
RESTORE_X86_FP_STATE at the top of
libcilkrts/runtime/config/x86/os-unix-sysdep.c because the code in the restore
and save routines is SSE only.  Note that changing floating point rounding
modes may not function as expected on 32-bit or with -mfpmath=387 set, however,
otherwise this simple fix is effective.

As already before, more information and this work-around is at 

https://software.intel.com/en-us/forums/topic/558825


[Bug middle-end/66983] [6 Regression] Many testsuite regressions

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66983

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #3 from Alexandre Oliva  ---
Fixed


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164
Bug 64164 depends on bug 66983, which changed state.

Bug 66983 Summary: [6 Regression] Many testsuite regressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66983

   What|Removed |Added

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


[Bug middle-end/67035] [6 Regression] FAIL: gcc.c-torture/compile/pr54713-3.c

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67035

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #3 from Alexandre Oliva  ---
Fixed


[Bug middle-end/67034] [6 Regression] FAIL: gcc.c-torture/compile/pr39928-1.c

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67034

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #6 from Alexandre Oliva  ---
Fixed


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164
Bug 64164 depends on bug 67034, which changed state.

Bug 67034 Summary: [6 Regression] FAIL: gcc.c-torture/compile/pr39928-1.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67034

   What|Removed |Added

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


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164
Bug 64164 depends on bug 66978, which changed state.

Bug 66978 Summary: [6 Regression] bootstrap failure with 
--with-multilib-list=m32,m64,mx32
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66978

   What|Removed |Added

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


[Bug bootstrap/66978] [6 Regression] bootstrap failure with --with-multilib-list=m32,m64,mx32

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66978

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #8 from Alexandre Oliva  ---
Fixed


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164
Bug 64164 depends on bug 67000, which changed state.

Bug 67000 Summary: [6 Regression] ICE in split_complex_args, at function.c:2325 
on ppc64le
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67000

   What|Removed |Added

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


[Bug rtl-optimization/67000] [6 Regression] ICE in split_complex_args, at function.c:2325 on ppc64le

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67000

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #6 from Alexandre Oliva  ---
Fixed


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164
Bug 64164 depends on bug 67035, which changed state.

Bug 67035 Summary: [6 Regression] FAIL: gcc.c-torture/compile/pr54713-3.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67035

   What|Removed |Added

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


[Bug rtl-optimization/64164] [4.9/5/6 Regression] one more stack slot used due to one less inlining level

2015-08-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #51 from Alexandre Oliva  ---
Fixed for the next major release.  Not planning a backport.


[Bug c/67224] UTF-8 support for identifier names in GCC

2015-08-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67224

--- Comment #2 from Andrew Pinski  ---
Related to bug 41374.


[Bug c/67224] UTF-8 support for identifier names in GCC

2015-08-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67224

--- Comment #3 from Andrew Pinski  ---
Have you tried -fextended-identifiers ?