[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-20 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #84 from Alexandre Oliva  ---
Author: aoliva
Date: Wed Dec 20 14:48:34 2017
New Revision: 255895

URL: https://gcc.gnu.org/viewcvs?rev=255895=gcc=rev
Log:
[SFN] debug markers before labels no more

Make sure that gimple and RTL IRs don't have debug markers before
labels.  When we build the CFG, we move labels before any markers
appearing before them.  Then, make sure we don't mistakenly
reintroduce them.

This reverts some of the complexity that had been brought about by the
initial SFN patches.

for  gcc/ChangeLog

PR bootstrap/83396
* cfgexpand.c (label_rtx_for_bb): Revert SFN changes that
allowed debug stmts before labels.
(expand_gimple_basic_block): Likewise.
* gimple-iterator.c (gimple_find_edge_insert_loc): Likewise.
* gimple-iterator.h (gsi_after_labels): Likewise.
* tree-cfgcleanup (remove_forwarder_block): Likewise, but
rename reused variable, and simplify using gsi_move_before.
* tree-ssa-tail-merge.c (find_duplicate): Likewise.
* tree-cfg.c (make_edges, cleanup_dead_labels): Likewise.
(gimple_can_merge_blocks_p, verify_gimple_in_cfg): Likewise.
(gimple_verify_flow_info, gimple_block_label): Likewise.
(make_blocks): Move debug markers after adjacent labels.
* cfgrtl.c (skip_insns_after_block): Revert SFN changes that
allowed debug insns outside blocks.
* df-scan.c (df_insn_delete): Likewise.
* lra-constraints.c (update_ebb_live_info): Likewise.
* var-tracking.c (get_first_insn, vt_emit_notes): Likewise.
(vt_initialize, delete_vta_debug_insns): Likewise.
(reemit_marker_as_note): Drop BB parm.  Adjust callers.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/cfgrtl.c
trunk/gcc/df-scan.c
trunk/gcc/gimple-iterator.c
trunk/gcc/gimple-iterator.h
trunk/gcc/lra-constraints.c
trunk/gcc/tree-cfg.c
trunk/gcc/tree-cfgcleanup.c
trunk/gcc/tree-ssa-tail-merge.c
trunk/gcc/var-tracking.c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #83 from Alexandre Oliva  ---
Having installed the pending patch that fixed the last known problem reported
in this PR, I think we're ready to close it.  If you know or find otherwise,
please reopen or add a comment with info about the problem.  Or perhaps open a
separate bug and copy me, considering it's not likely to be the same issue any
more, even if it's related with SFN in some way.

There's still some pending cleanup (patches in comments 76 and 77) that I'm
testing and that should be installed with a reference to this PR, but it's a
cleanup, not a fix, so I won't keep this open just on those grounds.

Thanks everyone for your help in providing information about problems that
popped up, and patience until they got addressed.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #82 from Alexandre Oliva  ---
Author: aoliva
Date: Tue Dec 19 17:50:31 2017
New Revision: 255833

URL: https://gcc.gnu.org/viewcvs?rev=255833=gcc=rev
Log:
[SFN] start rtl block with label, then markers

Emitting markers before labels turned out to not be worth the trouble.
The markers outside BBs confuse the ebb scheduler, and they don't add
any useful information.  I'll arrange for markers to be moved past
labels, even in gimple, but for now this will fix the two remaining
known problems on ia64.

for  gcc/ChangeLog

PR bootstrap/83396
* cfgexpand.c (expand_gimple_basic_block): Expand label first,
even if there are markers before it.
* cfgrtl.c (rtl_verify_bb_layout): Reject DEBUG_INSNs outside BBs.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/cfgrtl.c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #81 from ktkachov at gcc dot gnu.org ---
(In reply to Alexandre Oliva from comment #80)
> A preprocessed testcase and command line would be welcome to try to debug
> the armv8 issue.

Sorry for the confusion. The armv8 bootstrap indeed fails with a clean trunk,
but with the patch from comment 63 applied it passes cleanly.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #80 from Alexandre Oliva  ---
A preprocessed testcase and command line would be welcome to try to debug the
armv8 issue.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #79 from ktkachov at gcc dot gnu.org ---
(In reply to Christophe Lyon from comment #78)
> (In reply to ktkachov from comment #74)
> > (In reply to Alexandre Oliva from comment #70)
> > > ktkatchov, I'll submit the patch as soon as it completes testing, which
> > > should be Real Soon Now (TM) :-)  If you got the cycles to give it a spin,
> > > by all means let us know how it goes!  Thanks,
> > 
> > Thanks. That patch passes bootstrap and shows no regressions on
> > arm-none-linux-gnueabihf.
> 
> Kyrill,
> 
> As of r255666 I'm still seeing a bootstrap failure on
> armv8l-unknown-linux-gnueabihf:
> /tmp/ccPz4q2v.s: Assembler messages:
> /tmp/ccPz4q2v.s: Error: unaligned opcodes detected in executable segment
> make[3]: *** [c-family/c-omp.o] Error 1
> 
> configure flags:
> --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto
> --enable-shared --without-included-gettext --enable-nls
> --disable-sjlj-exceptions --enable-gnu-unique-object
> --enable-linker-build-id --disable-libstdcxx-pch --enable-c99
> --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long
> --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib
> --with-float=hard --with-fpu=neon-fp-armv8 --with-mode=thumb
> --with-arch=armv8-a --enable-threads=posix --enable-multiarch
> --enable-libstdcxx-time=yes --enable-gnu-indirect-function
> --enable-checking=yes --enable-bootstrap
> --enable-languages=c,c++,fortran,go,lto,objc,obj-c++
> 
> using binutils-2.28 branch
> 
> Is it the same config that works for you?

Hmm, with latest trunk at r255676 I do see the bootstrap failure in stage 3
when configured with --with-arch=armv8-a --with-fpu=neon-fp-armv8
--with-float=hard --with-mode=thumb --enable-multiarch
--enable-languages=c,c++,fortran
The testing I ran yesterday was --with-arch=armv7-a --with-fpu=neon
--with-float=hard --with-mode=thumb

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-15 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #78 from Christophe Lyon  ---
(In reply to ktkachov from comment #74)
> (In reply to Alexandre Oliva from comment #70)
> > ktkatchov, I'll submit the patch as soon as it completes testing, which
> > should be Real Soon Now (TM) :-)  If you got the cycles to give it a spin,
> > by all means let us know how it goes!  Thanks,
> 
> Thanks. That patch passes bootstrap and shows no regressions on
> arm-none-linux-gnueabihf.

Kyrill,

As of r255666 I'm still seeing a bootstrap failure on
armv8l-unknown-linux-gnueabihf:
/tmp/ccPz4q2v.s: Assembler messages:
/tmp/ccPz4q2v.s: Error: unaligned opcodes detected in executable segment
make[3]: *** [c-family/c-omp.o] Error 1

configure flags:
--with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared
--without-included-gettext --enable-nls --disable-sjlj-exceptions
--enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch
--enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long
--with-cloog=no --with-ppl=no --with-isl=no --disable-multilib
--with-float=hard --with-fpu=neon-fp-armv8 --with-mode=thumb
--with-arch=armv8-a --enable-threads=posix --enable-multiarch
--enable-libstdcxx-time=yes --enable-gnu-indirect-function
--enable-checking=yes --enable-bootstrap
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++

using binutils-2.28 branch

Is it the same config that works for you?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #77 from Alexandre Oliva  ---
Created attachment 42891
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42891=edit
fix libiberty/unix-pex bootstrap compare (stage3 configure)

... and if you find that bootstrap-debug compare fails in libiberty/unix-pex,
that's because the configure test for vfork fails: we start a new block for the
vfork call, even if all we had in the initial block was a debug marker.  Worse:
in this case, nothing connects the two blocks, so the vfork call and everything
else in the configure test gets optimized out.  If you are lucky,
-fcompare-debug will make that a compile failure, so the configure test result
will be different, and you'll get different code between the different stages. 
Otherwise, you might get a silent pass, and bootstrap will succeed.
Isn't that reason enough to bootstrap gcc with BUILD_CONFIG='bootstrap-debug
bootstrap-debug-lean bootstrap-debug-lib' at least once in a while? :-)

This patch reinstates the changes I'd made to fix this error some 13 months
ago, i.e., it re-reverts some of the changes that the previous patch reverted. 
They were not *just* to accept markers before labels.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #76 from Alexandre Oliva  ---
Created attachment 42890
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42890=edit
move markers after labels while building the cfg

This is a follow up to comment 61, that adjusts the IR to reject debug markers
before labels or outside BBs, and reverts the changes that had been introduced
to that end (at least those I could identify by going over the consolidated
SFN+LVU+IEPM patchset :-)

As written to gcc-patches, I will give this some thorough testing, and I'd
appreciate feedback on any compile, bootstrap or -fcompare-debug regressions
you detect with it.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #75 from joseph at codesourcery dot com  ---
As of GCC trunk r255655 I no longer see the GCC ICE building glibc for 
m68k (instead there's a non-ICE glibc build problem as noted in 
).

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #74 from ktkachov at gcc dot gnu.org ---
(In reply to Alexandre Oliva from comment #70)
> ktkatchov, I'll submit the patch as soon as it completes testing, which
> should be Real Soon Now (TM) :-)  If you got the cycles to give it a spin,
> by all means let us know how it goes!  Thanks,

Thanks. That patch passes bootstrap and shows no regressions on
arm-none-linux-gnueabihf.

Additionally, the gdb build now succeeds with the resultant compiler where
before it failed with the unaligned opcodes error

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #73 from Andreas Schwab  ---
I was using --without-build-config.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #72 from Jakub Jelinek  ---
(In reply to Andreas Schwab from comment #71)
> Bootstrap on ia64 with #c61 ended up with comparison failures.
> 
> gcc/cp/name-lookup.o differs
> gcc/cp/parser.o differs
> gcc/bb-reorder.o differs
> gcc/build/genrecog.o differs
> gcc/gcov.o differs
> gcc/wide-int.o differs
> gcc/c/c-decl.o differs
> gcc/c/c-parser.o differs
> gcc/tree-loop-distribution.o differs
> 
> The differences are only in the .debug_loc sections.

That is weird, .debug_loc sections shouldn't be emitted at all when -g0.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #71 from Andreas Schwab  ---
Bootstrap on ia64 with #c61 ended up with comparison failures.

gcc/cp/name-lookup.o differs
gcc/cp/parser.o differs
gcc/bb-reorder.o differs
gcc/build/genrecog.o differs
gcc/gcov.o differs
gcc/wide-int.o differs
gcc/c/c-decl.o differs
gcc/c/c-parser.o differs
gcc/tree-loop-distribution.o differs

The differences are only in the .debug_loc sections.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #70 from Alexandre Oliva  ---
ktkatchov, I'll submit the patch as soon as it completes testing, which should
be Real Soon Now (TM) :-)  If you got the cycles to give it a spin, by all
means let us know how it goes!  Thanks,

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ktkachov at gcc dot gnu.org

--- Comment #69 from ktkachov at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #68)
> Can you try the #c63 patch?  Perhaps the arm backend is yet another thing
> that doesn't really like debug insns outside of basic blocks...

Indeed, that fixes the error on arm. Do you plan to submit that? If so, I can
help with arm testing

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #68 from Jakub Jelinek  ---
Can you try the #c63 patch?  Perhaps the arm backend is yet another thing that
doesn't really like debug insns outside of basic blocks...

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #67 from ktkachov at gcc dot gnu.org ---
Thanks for working on this!

As of r255632 I'm still getting:
Error: unaligned opcodes detected in executable segment
on arm targets when building gdb. A reduced testcase is:
--

template  void xfree(T);
enum target_waitkind {
  TARGET_WAITKIND_SIGNALLED,
  TARGET_WAITKIND_LOADED,
  TARGET_WAITKIND_EXECD,
  TARGET_WAITKIND_SYSCALL_RETURN,
  TARGET_WAITKIND_SPURIOUS
};
class target_terminal {
public:
  static void m_fn1();
} a;
target_waitkind b;
void startup_inferior() {
  switch (b) {
  case TARGET_WAITKIND_SPURIOUS:
  case TARGET_WAITKIND_LOADED:
  case TARGET_WAITKIND_SIGNALLED:
  TARGET_WAITKIND_EXITED:
target_terminal::m_fn1();
  case TARGET_WAITKIND_EXECD:
xfree(a);
  }
}



The error can be reproduced with:
arm-none-eabi-g++ -O2 -g -c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #66 from Alexandre Oliva  ---
Jakub, *nod*, that's among the "changes added to support that".

Ulrich, thanks for the report.  r255639 compiles your testcase successfully on
x86_64-linux-gnu-x-spu-elf with -O -g, so I guess the problem was already fixed
by some of the already-installed patches.  If you find otherwise, please let me
know.  Thanks!

Andreas, thanks for the patch!

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread schwab at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #65 from Andreas Schwab  ---
Author: schwab
Date: Thu Dec 14 15:06:25 2017
New Revision: 255640

URL: https://gcc.gnu.org/viewcvs?rev=255640=gcc=rev
Log:
PR bootstrap/83396
* reload1.c (emit_input_reload_insns): Skip debug markers.

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

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread uweigand at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #64 from Ulrich Weigand  ---
I'm seeing the same error on spu-elf when building newlib with GCC revision
255614.  In case this isn't fixed by more recent changes already, here's a
reduced test case (build with -O -g):

const char *
test (const char *s)
{
  for (; ; s++)
switch (*s)
  {
  case '-':
  case 0:
return 0;

  case '\t':
  case '\n':
  case '\v':
  case '\f':
  case '\r':
  case ' ':
continue;

  default:
goto break2;
  }
break2:

  for (; *s >= '0' && *s <= '9'; s++)
;

  return s;
}

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #63 from Jakub Jelinek  ---
Comment on attachment 42885
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42885
expand labels before markers

If you do this, then we should also revert the var-tracking.c etc. changes to
look for debug insns outside of bbs and deal with them.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #62 from Alexandre Oliva  ---
Author: aoliva
Date: Thu Dec 14 15:02:58 2017
New Revision: 255638

URL: https://gcc.gnu.org/viewcvs?rev=255638=gcc=rev
Log:
[SFN] next/prev_nonnote_insn_bb are no more, even for ports

The patch that added _nondebug to next_ and prev_nonnote_insn_bb
failed to find and adjust uses within config.  Fixed.

for  gcc/ChangeLog

PR bootstrap/83396
* config/arc/arc.c (hwloop_optimize): Skip debug insns.
* config/sh/sh-protos.h (sh_find_set_of_reg): Adjust.
* config/sh/sh.c: Skip debug insns besides notes.
* config/sh/sh.md: Likewise.
* config/sh/sh_treg_combine.cc: Likewise.
* config/sh/sync.md: Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arc/arc.c
trunk/gcc/config/sh/sh-protos.h
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
trunk/gcc/config/sh/sh_treg_combine.cc
trunk/gcc/config/sh/sync.md

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #62 from Alexandre Oliva  ---
Author: aoliva
Date: Thu Dec 14 15:02:58 2017
New Revision: 255638

URL: https://gcc.gnu.org/viewcvs?rev=255638=gcc=rev
Log:
[SFN] next/prev_nonnote_insn_bb are no more, even for ports

The patch that added _nondebug to next_ and prev_nonnote_insn_bb
failed to find and adjust uses within config.  Fixed.

for  gcc/ChangeLog

PR bootstrap/83396
* config/arc/arc.c (hwloop_optimize): Skip debug insns.
* config/sh/sh-protos.h (sh_find_set_of_reg): Adjust.
* config/sh/sh.c: Skip debug insns besides notes.
* config/sh/sh.md: Likewise.
* config/sh/sh_treg_combine.cc: Likewise.
* config/sh/sync.md: Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arc/arc.c
trunk/gcc/config/sh/sh-protos.h
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
trunk/gcc/config/sh/sh_treg_combine.cc
trunk/gcc/config/sh/sync.md

--- Comment #63 from Jakub Jelinek  ---
Comment on attachment 42885
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42885
expand labels before markers

If you do this, then we should also revert the var-tracking.c etc. changes to
look for debug insns outside of bbs and deal with them.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #61 from Alexandre Oliva  ---
Created attachment 42885
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42885=edit
expand labels before markers

This patch fixes both ia64 problems.  Basically, the ebb scheduler gets
thoroughly confused by insns (even debug insns) outside BBs.  There's no good
reason for markers to be placed before RTL labels (or even gimple labels, but I
won't delay the fix further while I work on that), and although I can't say I
really meant to have them there, the little I did is proven to be not enough
and a lot of complication for no good reason, so...  I'll make sure we keep
debug insns (and stmts) within normal BB boundaries, and review the few changes
added to support that so as to revert them, if I can still identify them.

I haven't yet tested that we don't otherwise get debug insns outside BBs, aside
from successful compilation of the two ia64 preprocessed cases, so the cfgrtl.c
chunk may have to go for now to enable bootstraps to complete.  Please let me
know if you bootstrap with it and it passes; and if it fails, please keep the
preprocessed testcases coming my way ;-)  Thanks!

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #60 from Alexandre Oliva  ---
Joseph, thanks for the feedback.  I've fixed the SH (and ARC) build error in my
tree.

Andreas, thanks for the ia64 testcases, I'm looking into them.  From your email
address, is it correct to assume that it wouldn't be too hard for you to get me
a preprocessed case for the glibc build error on m68k?  Just hoping you have it
all handy, so that I can focus on fixing what I broke, instead of struggling to
duplicate infrastructure.  Thanks in advance,

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #59 from Jakub Jelinek  ---
Author: jakub
Date: Thu Dec 14 11:02:37 2017
New Revision: 255627

URL: https://gcc.gnu.org/viewcvs?rev=255627=gcc=rev
Log:
PR bootstrap/83396
* var-tracking.c (vt_initialize): Ignore non-DEBUG_INSNs outside of
basic blocks.  Assert debug bind insns don't appear outside of bbs,
don't reset them.  Assert insns without BLOCK_FOR_INSN are outside of
bb.  Simplify.

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

Added:
trunk/gcc/testsuite/gcc.dg/pr83396.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/var-tracking.c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #58 from joseph at codesourcery dot com  ---
With the latest build-many-glibcs.py build 
, using 
GCC trunk r255614, ia64 fails with an ICE building libgcc, m68k fails with 
an ICE building glibc, sh fails with prev_nonnote_insn_bb and 
next_nonnote_insn_bb undeclared compiling insn-emit.c.  The other 
compilations pass (though it's always possible ICEs will appear in the 
glibcs build, building additional glibc variants and the glibc testsuite).

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #57 from Andreas Schwab  ---
Created attachment 42878
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42878=edit
c-warn.ii

./xg++ -B./ -fno-PIE -S -g -O2 -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -fno-common c-warn.ii 
during RTL pass: mach
../../gcc/c-family/c-warn.c: In function ‘bool warn_if_unused_value(const_tree,
location_t)’:
../../gcc/c-family/c-warn.c:597:1: internal compiler error: in try_ready, at
haifa-sched.c:7524

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #56 from Andreas Schwab  ---
Created attachment 42877
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42877=edit
c-typeck.ii

./xg++ -B./ -fno-PIE -S -g -O2 -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -fno-common c-typeck.ii
during RTL pass: mach
../../gcc/c/c-typeck.c: In function ‘tree_node* build_unary_op(location_t,
tree_code, tree, bool)’:
../../gcc/c/c-typeck.c:4711:1: internal compiler error: in move_insn, at
haifa-sched.c:5465

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #55 from Jakub Jelinek  ---
Ok.  Can you please attach preprocessed source + gcc options that shows the two
ICEs?  Alex, can you please have a look?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #54 from Andreas Schwab  ---
Yes, just the patch from #c47 on top of master.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #53 from Jakub Jelinek  ---
Have you reverted the ia64.c change from the earlier patch?
I.e. testing just latest trunk (other patches are in) + #c47?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #52 from Andreas Schwab  ---
In fact, both ICEs are still present, so #c47 isn't any better.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #51 from Andreas Schwab  ---
The try_ready ICE from #c45 is still present with the patch from #c47.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #50 from Alexandre Oliva  ---
Author: aoliva
Date: Wed Dec 13 19:09:45 2017
New Revision: 255612

URL: https://gcc.gnu.org/viewcvs?rev=255612=gcc=rev
Log:
[SFN] don't eliminate regs in markers

Eliminate regs in debug bind insns, but not in markers.

for  gcc/ChangeLog

PR bootstrap/83396
* reload1.c (eliminate_regs_in_insn): Skip debug markers.

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

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #49 from Jakub Jelinek  ---
Author: jakub
Date: Wed Dec 13 18:47:45 2017
New Revision: 255610

URL: https://gcc.gnu.org/viewcvs?rev=255610=gcc=rev
Log:
PR bootstrap/83396
* final.c (rest_of_handle_final): Call variable_tracking_main only
if !flag_var_tracking.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/final.c
trunk/gcc/testsuite/ChangeLog

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #48 from Jakub Jelinek  ---
Author: jakub
Date: Wed Dec 13 18:46:43 2017
New Revision: 255609

URL: https://gcc.gnu.org/viewcvs?rev=255609=gcc=rev
Log:
PR bootstrap/83396
PR debug/83391
* tree-cfgcleanup.c (remove_forwarder_block): Keep after
labels debug stmts that can only appear after labels.

* gcc.dg/torture/pr83396.c: New test.
* g++.dg/torture/pr83391.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr83391.C
trunk/gcc/testsuite/gcc.dg/torture/pr83396.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfgcleanup.c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #47 from Jakub Jelinek  ---
Created attachment 42873
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42873=edit
gcc8-pr83396-ia64.patch

So what about this for the ia64 issue?  Rather than trying to force sanity into
the ia64 port, just keep what we've been doing except for DEBUG_INSNs, i.e.
process other insns only from BB_HEAD to BB_END, the rest only care about
DEBUG_INSNs and from those assert it isn't debug bind.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #46 from Jakub Jelinek  ---
(In reply to Andreas Schwab from comment #44)
> Breakpoint 1, fancy_abort (file=0x43d15300
> "../../gcc/haifa-sched.c", 
> line=5465, 
> function=0x43d164b8  rtx_def*)::__FUNCTION__> "move_insn") at ../../gcc/diagnostic.c:1500
> 1500  internal_error ("in %s, at %s:%d", function, trim_filename (file),
> line);
> (gdb) up
> #1  0x43632010 in move_insn (insn=0x2d6340f8, 
> last=0x2d6d4040, nt=0x2d887ec0)
> at ../../gcc/haifa-sched.c:5465
> 5465  gcc_assert (NOTE_INSN_BASIC_BLOCK_P (note));
> (gdb) p note
> $1 = (rtx_insn *) 0x2d772700
> (gdb) pr
> warning: Expression is not an assignment (and might have no effect)
> (debug_insn 5101 1610 8844 (debug_marker) "../../gcc/c/c-typeck.c":4700 -1
>  (nil))

Ugh.  In that case it might be conceptually better if the group barriers were
actually notes, on the other side we don't have support for target dependent
notes.
In that case, I guess we need to punt on all the checking.  Let me tweak the
#c30 patch :(.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #45 from Andreas Schwab  ---
Starting program: /usr/local/gcc/test/Build/prev-gcc/cc1plus -quiet -nostdinc++
-I
/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
-I /usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include -I
/usr/local/gcc/test/libstdc++-v3/libsupc++ -I . -I c-family -I ../../gcc -I
../../gcc/c-family -I ../../gcc/../include -I ../../gcc/../libcpp/include -I
../../gcc/../libdecnumber -I ../../gcc/../libdecnumber/dpd -I ../libdecnumber
-I ../../gcc/../libbacktrace -iprefix
/usr/local/gcc/test/Build/prev-gcc/../lib/gcc/ia64-suse-linux/8.0.0/ -isystem
/usr/local/gcc/test/Build/./prev-gcc/include -isystem
/usr/local/gcc/test/Build/./prev-gcc/include-fixed -MMD c-family/c-warn.d -MF
c-family/.deps/c-warn.TPo -MP -MT c-family/c-warn.o -D_GNU_SOURCE -D
USE_LIBUNWIND_EXCEPTIONS -D IN_GCC_FRONTEND -D IN_GCC_FRONTEND -D IN_GCC -D
HAVE_CONFIG_H ../../gcc/c-family/c-warn.c -quiet -dumpbase c-warn.c
-auxbase-strip c-family/c-warn.o -g -O2 -Wextra -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wsuggest-attribute=format -Woverloaded-virtual
-Wpedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-fno-PIE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -fno-common
Failed to read a valid object file image from memory.

Breakpoint 1, fancy_abort (file=0x43d15300 "../../gcc/haifa-sched.c", 
line=7524, 
function=0x43d16568 
"try_ready") at ../../gcc/diagnostic.c:1500
1500  internal_error ("in %s, at %s:%d", function, trim_filename (file),
line);
(gdb) up
#1  0x43643690 in try_ready (next=0x2582f100)
at ../../gcc/haifa-sched.c:7520
7520  gcc_assert (!(old_ts & ~(SPECULATIVE | HARD_DEP | DEP_CONTROL |
DEP_POSTPONED))
(gdb) p next
$2 = (rtx_insn *) 0x2582f100
(gdb) pr
warning: Expression is not an assignment (and might have no effect)
(debug_insn 1847 1400 1837 (debug_marker) "../../gcc/c-family/c-warn.c":594 -1
 (nil))

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #44 from Andreas Schwab  ---

Breakpoint 1, fancy_abort (file=0x43d15300 "../../gcc/haifa-sched.c", 
line=5465, 
function=0x43d164b8  "move_insn") at ../../gcc/diagnostic.c:1500
1500  internal_error ("in %s, at %s:%d", function, trim_filename (file),
line);
(gdb) up
#1  0x43632010 in move_insn (insn=0x2d6340f8, 
last=0x2d6d4040, nt=0x2d887ec0)
at ../../gcc/haifa-sched.c:5465
5465  gcc_assert (NOTE_INSN_BASIC_BLOCK_P (note));
(gdb) p note
$1 = (rtx_insn *) 0x2d772700
(gdb) pr
warning: Expression is not an assignment (and might have no effect)
(debug_insn 5101 1610 8844 (debug_marker) "../../gcc/c/c-typeck.c":4700 -1
 (nil))

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #43 from joseph at codesourcery dot com  ---
The build-many-glibcs.py builds with mainline tools start 24 hours after 
the previous such build finished (so the next one will start at 21:44 UTC 
today; if all the build problems are fixed, it would be about 7 hours from 
then for both the "compilers" and the "glibcs" builds to complete).

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #42 from Andreas Schwab  ---
Reconfigured with --without-buildconfig:

/ -B/usr/ia64-suse-linux/bin/ -nostdinc++
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs 
-I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
 -I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include 
-I/usr/local/gcc/test/libstdc++-v3/libsupc++
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DUSE_LIBUNWIND_EXCEPTIONS -DIN_GCC_FRONTEND -g -O2 -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-fno-common  -DHAVE_CONFIG_H -I. -Ic -I../../gcc -I../../gcc/c
-I../../gcc/../include -I../../gcc/../libcpp/include 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace   -o c/c-typeck.o -MT c/c-typeck.o -MMD -MP -MF
c/.deps/c-typeck.TPo ../../gcc/c/c-typeck.c
during RTL pass: mach
../../gcc/c/c-typeck.c: In function ‘tree_node* build_unary_op(location_t,
tree_code, tree, bool)’:
../../gcc/c/c-typeck.c:4711:1: internal compiler error: in move_insn, at
haifa-sched.c:5465
 }
 ^
0x4363200f move_insn
../../gcc/haifa-sched.c:5465
0x4363757f commit_schedule
../../gcc/haifa-sched.c:6205
0x4363f40f schedule_block(basic_block_def**, void*)
../../gcc/haifa-sched.c:7040
0x438503af schedule_ebb(rtx_insn*, rtx_insn*, bool)
../../gcc/sched-ebb.c:537
0x4385126f schedule_ebbs()
../../gcc/sched-ebb.c:657
0x42c7b0cf ia64_reorg
../../gcc/config/ia64/ia64.c:9863
0x41e151af execute
../../gcc/reorg.c:3948
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
make[3]: *** [c/c-typeck.o] Error 1
make[3]: Leaving directory `/usr/local/gcc/test/Build/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/usr/local/gcc/test/Build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/usr/local/gcc/test/Build'
make: *** [all] Error 2

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #41 from Andreas Schwab  ---
/usr/local/gcc/test/Build/./prev-gcc/xg++
-B/usr/local/gcc/test/Build/./prev-gcc/ -B/usr/ia64-suse-linux/bin/ -nostdinc++
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs 
-I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
 -I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include 
-I/usr/local/gcc/test/libstdc++-v3/libsupc++
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DUSE_LIBUNWIND_EXCEPTIONS  -g -O2 -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
-Wno-error -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace   -o insn-attrtab.o -MT insn-attrtab.o -MMD -MP -MF
./.deps/insn-attrtab.TPo insn-attrtab.c
during RTL pass: mach
../../gcc/config/ia64/itanium2.md: In function ‘attr_type
get_attr_type(rtx_insn*)’:
../../gcc/config/ia64/itanium2.md:4336:1: internal compiler error: in
try_ready, at haifa-sched.c:7524
0x4018d53f ???
../sysdeps/ia64/elf/start.S:106
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
make[3]: *** [insn-attrtab.o] Error 1
make[3]: *** Waiting for unfinished jobs
make[3]: Leaving directory `/usr/local/gcc/test/Build/gcc'
make[2]: *** [all-stage3-gcc] Error 2
make[2]: Leaving directory `/usr/local/gcc/test/Build'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/usr/local/gcc/test/Build'
make: *** [all] Error 2

(gdb) bt
#0  0x401843a0 in fancy_abort(char const*, int, char const*) ()
#1  0x42557890 in try_ready(rtx_insn*) ()
#2  0x426cd6c0 in init_ready_list ()
#3  0x42560f80 in schedule_block(basic_block_def**, void*) ()
#4  0x426ce690 in schedule_ebb(rtx_insn*, rtx_insn*, bool) ()
#5  0x426cfa10 in schedule_ebbs() ()
#6  0x41f16a60 in ia64_reorg() ()
#7  0x4150add0 in (anonymous
namespace)::pass_machine_reorg::execute(function*) ()
#8  0x413e9c90 in execute_one_pass(opt_pass*) ()
#9  0x413eb380 in execute_pass_list_1(opt_pass*) ()
#10 0x413eb410 in execute_pass_list_1(opt_pass*) ()
#11 0x413eb410 in execute_pass_list_1(opt_pass*) ()
#12 0x413eb4f0 in execute_pass_list(function*, opt_pass*) ()
#13 0x40b52aa0 in cgraph_node::expand() ()
#14 0x40b569e0 in symbol_table::compile() [clone .part.70] ()
#15 0x40b5da80 in symbol_table::finalize_compilation_unit() ()
#16 0x41631030 in compile_file() ()
#17 0x40188610 in toplev::main(int, char**) ()
#18 0x4018d190 in main ()

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Jakub Jelinek  changed:

   What|Removed |Added

 CC||doko at gcc dot gnu.org

--- Comment #40 from Jakub Jelinek  ---
*** Bug 83405 has been marked as a duplicate of this bug. ***

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #39 from Jakub Jelinek  ---
(In reply to David Edelsohn from comment #37)
> Jakub, the -fcompare-debug failure is not new.  The root cause has been
> analyzed before. AIX specifically does not want to push unnecessary stack
> frames for code that is not compiled with debugging solely for matching code
> generation.

The question is, is it really needed for proper debugging even after 12 years
since it has been checked last (and even in that case it doesn't look like it
has been verified it doesn't work)?  And, if it is needed for XCOFF_DEBUG, is
it also needed for DWARF2_DEBUG?  I mean, at least the dwarf case in theory
should have all means to represent automatic variables in the frame regardless
of it, and gdb must handle it too.  What other debuggers you use on aix for
-gdwarf-* debugging?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #38 from Jakub Jelinek  ---
So a CODE_LABEL with NULL BLOCK_FOR_INSN?  Ugh, that sounds broken.
In the patch a workaround is of course easy, just replace:
+ if (BB_HEAD (BLOCK_FOR_INSN (last_label)) == last_label)
+   BLOCK_FOR_INSN (insn) = NULL;
with
+ if (BLOCK_FOR_INSN (last_label)
+ && BB_HEAD (BLOCK_FOR_INSN (last_label)) == last_label)
+   BLOCK_FOR_INSN (insn) = NULL;

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #37 from David Edelsohn  ---
Jakub, the -fcompare-debug failure is not new.  The root cause has been
analyzed before. AIX specifically does not want to push unnecessary stack
frames for code that is not compiled with debugging solely for matching code
generation.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #36 from Andreas Schwab  ---
/usr/local/gcc/test/Build/./prev-gcc/xg++
-B/usr/local/gcc/test/Build/./prev-gcc/ -B/usr/ia64-suse-linux/bin/ -nostdinc++
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-B/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs 
-I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
 -I/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/include 
-I/usr/local/gcc/test/libstdc++-v3/libsupc++
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/src/.libs
-L/usr/local/gcc/test/Build/prev-ia64-suse-linux/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DUSE_LIBUNWIND_EXCEPTIONS  -g -O2 -gtoggle -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace   -o insn-recog.o -MT insn-recog.o -MMD -MP -MF
./.deps/insn-recog.TPo insn-recog.c
during RTL pass: mach
../../gcc/config/ia64/vect.md: In function ‘int recog_9(rtx, rtx_insn*, int*)’:
../../gcc/config/ia64/vect.md:1510:1: internal compiler error: Segmentation
fault
 (define_expand "vec_unpacks_lo_"
 ^
0x41feac6f crash_signal
../../gcc/toplev.c:325
0x42c64c9f emit_insn_group_barriers
../../gcc/config/ia64/ia64.c:7106
0x42c7b10f ia64_reorg
../../gcc/config/ia64/ia64.c:9872
0x41e151af execute
../../gcc/reorg.c:3948
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
make[3]: *** [insn-recog.o] Error 1
make[3]: *** Waiting for unfinished jobs
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod gcov-dump.pod
gcov-tool.pod
make[3]: Leaving directory `/usr/local/gcc/test/Build/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/usr/local/gcc/test/Build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/usr/local/gcc/test/Build'
make: *** [all] Error 2

Program received signal SIGSEGV, Segmentation fault.
0x42c64ca0 in emit_insn_group_barriers (dump=0x0)
at ../../gcc/config/ia64/ia64.c:7106
7106  if (BB_HEAD (BLOCK_FOR_INSN (last_label)) ==
last_label)
(gdb) p last_label
$1 = (rtx_insn *) 0x26155440
(gdb) pr
warning: Expression is not an assignment (and might have no effect)
(code_label 425 4296 426 1431 (nil) [3 uses])

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #35 from Jakub Jelinek  ---
Discussed in the https://gcc.gnu.org/ml/gcc-patches/2003-03/msg01693.html
thread.
Thus, David, can you check if AIX debugging even without push_p?  Perhaps
separately -gdwarf-{2,3,4} and the default debugging?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #34 from Jakub Jelinek  ---
Ok, reduced testcase for the -fcompare-debug (length) issue is just:
void fn1() {}
with -O2 -gdwarf-4 -fcompare-debug
The *.ira dump is still identical, but reload has:
--- pr83396.ii.276r.reload  2017-12-13 16:31:30.077467285 +0100
+++ pr83396.ii.gk.276r.reload   2017-12-13 16:31:30.144466454 +0100
@@ -6,10 +6,10 @@

   Spilling non-eliminable hard regs: 1
 New elimination table:
-Can eliminate 31 to 1 (offset=0, prev_offset=0)
-Can eliminate 111 to 1 (offset=0, prev_offset=0)
+Can eliminate 31 to 1 (offset=-32, prev_offset=0)
+Can eliminate 111 to 1 (offset=-32, prev_offset=0)
 Can eliminate 111 to 31 (offset=0, prev_offset=0)
-Can eliminate 67 to 1 (offset=32, prev_offset=0)
+Can eliminate 67 to 1 (offset=0, prev_offset=0)
 Can eliminate 67 to 31 (offset=32, prev_offset=0)
 Can eliminate 30 to 30 (offset=0, prev_offset=0)
   Spilling non-eliminable hard regs: 1
@@ -36,10 +36,10 @@ EBB 2
   Spilling non-eliminable hard regs: 1
   Spilling non-eliminable hard regs: 1
 New elimination table:
-Can eliminate 31 to 1 (offset=0, prev_offset=0)
-Can eliminate 111 to 1 (offset=0, prev_offset=0)
+Can eliminate 31 to 1 (offset=-32, prev_offset=-32)
+Can eliminate 111 to 1 (offset=-32, prev_offset=-32)
 Can eliminate 111 to 31 (offset=0, prev_offset=0)
-Can eliminate 67 to 1 (offset=32, prev_offset=32)
+Can eliminate 67 to 1 (offset=0, prev_offset=0)
 Can eliminate 67 to 31 (offset=32, prev_offset=0)
 Can eliminate 30 to 30 (offset=0, prev_offset=0)
differences.

The bug is obvious, rs6000_stack_info has:
  else if (TARGET_XCOFF && write_symbols != NO_DEBUG)
info->push_p = 1;
so it generates different code based on whether -g is enabled or not.
Clearly that is a preexisting bug.  If it is for whatever reason needed, can't
it be done regardless of -g, i.e.
  else if (TARGET_XCOFF)
info->push_p = 1;
or, if you are ok with -fcompare-debug being broken for the default stabs or
whatever AIX uses for debugging (which implies different code generation
between -g and -g0), at least do it like:
  else if (TARGET_XCOFF && write_symbols != NO_DEBUG && write_symbols !=
DWARF2_DEBUG)
info->push_p = 1;

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #33 from Jakub Jelinek  ---
I can reproduce the -fcompare-debug failure with cross to aix with the whole
patchset, creduce is running now.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #32 from Christophe Lyon  ---
(In reply to Christophe Lyon from comment #26)
> I have attached gload.i and gload.s to help you reproduce the problem on arm
> --with-mode=thumb.
> 
> I will also perform some tests with the patch series posted here.

Applying patches from comments 15,18,19 and 20 fixes the problems I saw on arm:
- build now completes with -mthumb
- pr69102 passes

Thanks

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #31 from Jakub Jelinek  ---
Created attachment 42866
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42866=edit
gcc8-pr83396.patch

Variant patch, with assert checking.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #30 from Jakub Jelinek  ---
Created attachment 42865
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42865=edit
gcc8-pr83396.patch

Untested patch for the IA64 ICE.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #29 from Jakub Jelinek  ---
(In reply to Andreas Schwab from comment #28)
> Reduced testcase for #c27:
> 
> int f1 (int);
> int f2 (int);
> int
> foo (int f)
> {
>   return f1 (f) || f2 (f) != 0;
> }

This is IMNSHO a bug in the ia64 backend.  The group barrier added before
BB_HEAD of bb4 should not claim it is inside of bb4.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #28 from Andreas Schwab  ---
Reduced testcase for #c27:

int f1 (int);
int f2 (int);
int
foo (int f)
{
  return f1 (f) || f2 (f) != 0;
}

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #27 from Andreas Schwab  ---
On ia64, even after applying all patches, there is still an ICE:

configure:4279: /usr/local/gcc/test/Build/./gcc/xgcc
-B/usr/local/gcc/test/Build/./gcc/ -B/usr/ia64-suse-linux/bin/
-B/usr/ia64-suse-linux/lib/ -isystem /usr/ia64-suse-linux/include -isystem
/usr/ia64-suse-linux/sys-include-o conftest -g -O2   conftest.c  >&5
during RTL pass: mach
conftest.c: In function 'main':
conftest.c:41:1: internal compiler error: in vt_initialize, at
var-tracking.c:10185
 }
 ^
0x4182a3bf vt_initialize
../../gcc/var-tracking.c:10185
0x4182ac0f variable_tracking_main_1
../../gcc/var-tracking.c:10433
0x4182ac0f variable_tracking_main()
../../gcc/var-tracking.c:10488
0x418d22ff ia64_reorg
../../gcc/config/ia64/ia64.c:9913
0x40f63c8f execute
../../gcc/reorg.c:3948
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
configure:4279: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/;
| /* end confdefs.h.  */
| /* none */
| static long int longval () { return (long int) (sizeof (double)); }
| static unsigned long int ulongval () { return (long int) (sizeof (double)); }
| #include 
| #include 
| int
| main ()
| {
| 
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
| return 1;
|   if (((long int) (sizeof (double))) < 0)
| {
|   long int i = longval ();
|   if (i != ((long int) (sizeof (double
|   return 1;
|   fprintf (f, "%ld", i);
| }
|   else
| {
|   unsigned long int i = ulongval ();
|   if (i != ((long int) (sizeof (double
|   return 1;
|   fprintf (f, "%lu", i);
| }
|   /* Do not output a trailing newline, as this causes \r\n confusion
|  on some platforms.  */
|   return ferror (f) || fclose (f) != 0;
| 
|   ;
|   return 0;
| }

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #26 from Christophe Lyon  ---
I have attached gload.i and gload.s to help you reproduce the problem on arm
--with-mode=thumb.

I will also perform some tests with the patch series posted here.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #25 from Christophe Lyon  ---
Created attachment 42863
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42863=edit
Assembler for arm-thumb

This is the assembler file created with -mthumb, for which gas complains.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #24 from Christophe Lyon  ---
Created attachment 42862
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42862=edit
Preprocessed file for arm-thumb

Compilation of this file with -mthumb makes the assembler complain with:
gload.s: Assembler messages:
gload.s: Error: unaligned opcodes detected in executable segment

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #23 from Andreas Schwab  ---
#c18 fixes the ICE on m68k which had the same problem as ia64.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #22 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #17 from Alexandre Oliva  ---
> Rainier, I wasn't sure how "same" the bootstrap failure you'd observed was,
> that's why I'd asked for a preprocessed testcase.  Now, since the patch fixed
> the problem, nevermind.  I'll look into the regression, though since it 
> remains
> it's unlikely to be the same underlying issue.  It's quite plausible that it's
> also caused by the SFN patchset, just like the failures Joseph mentioned.

I've just finished a fresh sparc-sun-solaris2.11 bootstrap with the
three patches of yours + Jakub's (from the PR, assuming they are
identical to what you posted to gcc-patches).  Both the bootstrap
failure and the testsuite regression are gone, so we're back to normal.

Thanks for the quick fixes.

Rainer

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Christophe Lyon  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #21 from Christophe Lyon  ---
FWIW, I also noticed the failure reported on pr69102 on aarch64 and arm.

I didn't check the patch in comment #19 yet.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #20 from Jakub Jelinek  ---
Created attachment 42861
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42861=edit
gcc8-pr83396-verify.patch

For the label verification I meant something like this (untested except that
without your candidate patch it fails on the PR83391 testcase), if that is how
we want to define the IL (the tree-cfg.c verify_* routines define what is and
what is not valid GIMPLE).

As for -fcompare-debug FAILure, if you go to sleep, could you share details on
what fails, preferrably with preprocessed source + options?
The bootstrap failures on so many targets need to be resolved very soon.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #19 from Alexandre Oliva  ---
Created attachment 42860
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42860=edit
additional patch for the sparc pr69102 FAIL

This patch fixes the testsuite regression reported by Rainier on sparc.  We
can't assume we're outside a BB just because BLOCK_FOR_INSN is not set: not all
paths that take to var-tracking will run compute_bb_for_insn or similar.  That
was news to me.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #18 from Alexandre Oliva  ---
Created attachment 42859
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42859=edit
additional patch for the ia64 problem reported by andreas

Andreas, this patch (on top of the other) enables your testcase to compile. 
Would you please confirm that both patches bring ia64 back to bootstrap land,
and whether any regressions remain?  Thanks in advance,

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #17 from Alexandre Oliva  ---
Rainier, I wasn't sure how "same" the bootstrap failure you'd observed was,
that's why I'd asked for a preprocessed testcase.  Now, since the patch fixed
the problem, nevermind.  I'll look into the regression, though since it remains
it's unlikely to be the same underlying issue.  It's quite plausible that it's
also caused by the SFN patchset, just like the failures Joseph mentioned.

Joseph, I suppose those builds are automated; how often do they run?  I shall
watch it out for remaining problems once this fix goes in.  Thanks!

David, thanks for confirming that reversal allows bootstrap to complete.  I'm a
bit surprised, however, that you didn't run into any compare errors.  Although
-fcompare-debug is a bit more stringent, I'm seeing actual codegen diffs (with
the proposed patch).  Did you skip bootstrap compare, or are you not using the
default bootstrap-debug configuration (that would probably have caught this
codegen diff)?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Alexandre Oliva  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #16 from Alexandre Oliva  ---
*** Bug 83391 has been marked as a duplicate of this bug. ***

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #15 from Alexandre Oliva  ---
Created attachment 42858
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42858=edit
candidate patch

This patch enables the initial bug report to compile successfully (though with
-fcompare-debug it fails); the reduced testcase compiles and passes
-fcompare-debug, so the -fcompare-debug error is probably a separate problem.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #14 from David Edelsohn  ---
AIX is able to bootstrap with the remove_forwarder_block changes reverted.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #13 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #11 from Alexandre Oliva  ---
> the problem is that a concatn resulting from decomposing a reg is not unshared
> in a debug insn because it's between blocks.  reverting the
> remove_forwarder_block part of the tree-cfgcleanup.c changes in r255566 avoids
> the problem.  still investigating...
>
> feedback on whether your bootstrap failure is affected by reverting this hunk
> (aside from the original bug report; that one is covered) is welcome

After that reversion, sparc-sun-solaris2.11 bootstrap is into make check now.

Besides, I've also manually compiled the stage3 gimple-pretty-print.c
with -g0 and completed the bootstrap this way.  There's only one
testsuite regression then:

+FAIL: gcc.c-torture/compile/pr69102.c   -O3 -g  (internal compiler error)
+FAIL: gcc.c-torture/compile/pr69102.c   -O3 -g  (test for excess errors)

Excess errors:
during RTL pass: final
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.c-torture/compile/pr69102.c:23:1:
internal compiler error: in vt_initialize, at var-tracking.c:10172
0xdef613 vt_initialize
/vol/gcc/src/hg/trunk/local/gcc/var-tracking.c:10172
0xdf8daf variable_tracking_main_1
/vol/gcc/src/hg/trunk/local/gcc/var-tracking.c:10429
0xdf8daf variable_tracking_main()
/vol/gcc/src/hg/trunk/local/gcc/var-tracking.c:10484
0x6d990b rest_of_handle_final
/vol/gcc/src/hg/trunk/local/gcc/final.c:4546
0x6d990b execute
/vol/gcc/src/hg/trunk/local/gcc/final.c:4624

which is probably related.

> at least the ia64 failure mode is so different that it's not likely to be the
> same problem.  as for the sparc one, I'd appreciate a preprocessed testcase to
> look into it as well.  thanks!

Beyond the reduced testcase Jakub provided, you mean?

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #12 from joseph at codesourcery dot com  ---
https://sourceware.org/ml/libc-testresults/2017-q4/msg00460.html

shows GCC build failures on alpha, hppa, ia64, m68k, microblaze, sh, 
tilegx, tilepro.  (The cases where the GCC build completed but the glibc 
build failed are unrelated and should now be fixed in glibc.)

I haven't verified that all of these are caused by the SFN changes, but it 
seems plausible they are.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #11 from Alexandre Oliva  ---
the problem is that a concatn resulting from decomposing a reg is not unshared
in a debug insn because it's between blocks.  reverting the
remove_forwarder_block part of the tree-cfgcleanup.c changes in r255566 avoids
the problem.  still investigating...

feedback on whether your bootstrap failure is affected by reverting this hunk
(aside from the original bug report; that one is covered) is welcome

at least the ia64 failure mode is so different that it's not likely to be the
same problem.  as for the sparc one, I'd appreciate a preprocessed testcase to
look into it as well.  thanks!

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #10 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #9 from Jakub Jelinek  ---
> Reduced testcase for AIX, -O2 -gdwarf-4 (both C and C++):

Also fails on Solaris/SPARC, though still with -gdwarf-2.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #9 from Jakub Jelinek  ---
Reduced testcase for AIX, -O2 -gdwarf-4 (both C and C++):

int fn1 (void);
void fn2 (void *, const char *);
void fn3 (void);

void
fn4 (long long x)
{
  fn3 ();
}

void
fn5 (long long x)
{
  if (x)
fn3();
}

void
fn6 (long long x)
{
  switch (fn1 ())
{
case 0:
  fn5 (x);
case 2:
  fn2 (0, "");
  break;
case 1:
case 3:
  fn4(x);
case 5:
  fn2 (0, "");
}
}

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Rainer Orth  changed:

   What|Removed |Added

 Target|powerpc-ibm-aix*, ia64-*-*  |powerpc-ibm-aix*, ia64-*-*,
   ||sparc-sun-solaris*
 CC||ro at gcc dot gnu.org

--- Comment #8 from Rainer Orth  ---
I'm seeing the same failure as David on Solaris 11/SPARC.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Andreas Schwab  changed:

   What|Removed |Added

 Target|powerpc-ibm-aix*|powerpc-ibm-aix*, ia64-*-*

--- Comment #7 from Andreas Schwab  ---
Also breaks bootstrap on ia64.

$ echo 'int main(){return 0;}' > x.c
$ gcc/xgcc -B gcc/ -O2 -g -S x.c
during RTL pass: reload
x.c: In function ‘main’:
x.c:1:1: internal compiler error: RTL flag check: INSN_VAR_LOCATION used with
un
expected rtx code 'debug_marker' in eliminate_regs_in_insn, at reload1.c:3206
 int main(){return 0;}
 ^~~
0x4016120f rtl_check_failed_flag(char const*, rtx_def const*, char
const*, int, char const*)
../../gcc/rtl.c:896
0x40f534bf eliminate_regs_in_insn
../../gcc/reload1.c:3206
0x40f5e39f calculate_needs_all_insns
../../gcc/reload1.c:1467
0x40f5e39f reload(rtx_insn*, int)
../../gcc/reload1.c:985
0x40bb92cf do_reload
../../gcc/ira.c:5455
0x40bb92cf execute
../../gcc/ira.c:5627

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #6 from Jakub Jelinek  ---
Alex, please have a look at this.
The problem is again the debug stmts (insns in this case) in unexpected spots.
Both the
;; Insn is not within a basic block
(debug_insn 4582 4581 4583 (var_location:DI flags (reg/v:DI 559 [ flags ]))
"/nasfarm/edelsohn/src/sandbox/gcc/gimple-pretty-print.c":2567 -1
 (nil))
and
;; Insn is not within a basic block
(debug_insn 5064 5063 5065 (var_location:SI spc (reg/v:SI 558 [ spc ]))
"/nasfarm/edelsohn/src/sandbox/gcc/gimple-pretty-print.c":2583 -1
 (nil))
insns are emitted in between a barrier and later code_label and appear there in
the *.expand/*.vregs dump, but then we go into the cfglayout mode and the
instructions are moved into the BB_FOOTER of some basic block (or BB_HEADER?)
and remain there until outof_cfglayout pass.  Most RTL passes assume there is
no interesting IL in there though, it isn't even dumped in dumps, and most of
the bb walks just ignore it, typically just notes or barriers should be there.
So, if we end up with debug insns in there, we just risk they will not be
properly maintained.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #5 from David Edelsohn  ---
Requires DWARF debugging when building the file, e.g., -gdwarf-4, or DWARF
debugging set as default in configuration file.

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #4 from David Edelsohn  ---
Created attachment 42854
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42854=edit
AIX auto-host.h build file

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #3 from David Edelsohn  ---
Created attachment 42853
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42853=edit
aix configuration file

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
   Target Milestone|--- |8.0

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #2 from David Edelsohn  ---
Created attachment 42852
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42852=edit
preprocessed source

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-12 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

David Edelsohn  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-12
 CC||aoliva at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from David Edelsohn  ---
Confirmed.