Bug 71413 - [7 Regression] bootstrap (gnat) broken on arm-linux-gnueabi*
Summary: [7 Regression] bootstrap (gnat) broken on arm-linux-gnueabi*
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, wrong-code
Depends on:
Blocks: 52171
  Show dependency treegraph
 
Reported: 2016-06-04 17:08 UTC by Matthias Klose
Modified: 2016-06-09 16:28 UTC (History)
2 users (show)

See Also:
Host:
Target: arm-*-*, ia64-*-*
Build:
Known to work: 6.1.0
Known to fail: 7.0
Last reconfirmed: 2016-06-06 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2016-06-04 17:08:24 UTC
trunk 20160603 fails to build on arm-linux-gnueabi* with

Comparing stages 2 and 3
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1objplus-checksum.o differs
Bootstrap comparison failure!
gcc/ada/sem_ch13.o differs
Makefile:23154: recipe for target 'compare' failed
make[4]: *** [compare] Error 1

armhf is configured with

         --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++
         --prefix=/usr/lib/gcc-snapshot
         --enable-shared
         --enable-linker-build-id
         --disable-nls
         --with-sysroot=/
         --enable-clocale=gnu
         --enable-libstdcxx-debug
         --enable-libstdcxx-time=yes
         --with-default-libstdcxx-abi=new
         --enable-gnu-unique-object
         --disable-libitm
         --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-7-snap-armhf/jre
         --enable-java-home
         --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-7-snap-armhf
         --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-7-snap-armhf
         --with-arch-directory=arm
         --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
         --enable-objc-gc
         --enable-multiarch
         --enable-multilib
         --disable-sjlj-exceptions
         --with-arch=armv7-a
         --with-fpu=vfpv3-d16
         --with-float=hard
         --with-mode=thumb
         --disable-werror
         --enable-multilib
         --enable-checking=yes
         --build=arm-linux-gnueabihf
         --host=arm-linux-gnueabihf
         --target=arm-linux-gnueabihf

armel is configured with

	 --prefix=/usr/lib/gcc-snapshot
	 --enable-shared
	 --enable-linker-build-id
	 --disable-nls
	 --with-sysroot=/
	 --enable-clocale=gnu
	 --enable-libstdcxx-debug
	 --enable-libstdcxx-time=yes
	 --with-default-libstdcxx-abi=new
	 --enable-gnu-unique-object
	 --disable-libitm
	 --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-7-snap-armel/jre
	 --enable-java-home
	 --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-7-snap-armel
	 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-7-snap-armel
	 --with-arch-directory=arm
	 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
	 --enable-objc-gc
	 --enable-multiarch
	 --disable-sjlj-exceptions
	 --with-arch=armv4t
	 --with-float=soft
	 --disable-werror
	 --enable-checking=yes
	 --build=arm-linux-gnueabi
	 --host=arm-linux-gnueabi
	 --target=arm-linux-gnueabi
Comment 1 Andreas Schwab 2016-06-05 19:53:31 UTC
Also broken on ia64, caused by r237069.
Comment 2 Bernd Schmidt 2016-06-06 01:06:10 UTC
Oof, I don't think I'll be able to reproduce an Ada failure on ARM. Can you narrow the problem down a bit, identifying what the differences are?
Comment 3 Bernd Schmidt 2016-06-06 08:42:53 UTC
Also, to help narrow it down, can you try it with this patch?

Index: tree-ssa-strlen.c
===================================================================
--- tree-ssa-strlen.c	(revision 237069)
+++ tree-ssa-strlen.c	(working copy)
@@ -1860,7 +1860,7 @@ handle_builtin_memcmp (gimple_stmt_itera
   use_operand_p use_p;
   imm_use_iterator iter;
 
-  if (!res)
+  if (1 || !res)
     return true;
 
   FOR_EACH_IMM_USE_FAST (use_p, iter, res)
Comment 4 Andreas Schwab 2016-06-06 11:02:48 UTC
This fixes the comparison failure on ia64.
Comment 5 Andreas Schwab 2016-06-06 14:31:18 UTC
I see sem_ch13__new_stream_subprogram__build_spec.9906 in stage3 calling memcmp whereas it is inlined in stage2.  That appears to be the only difference.
Comment 6 Bernd Schmidt 2016-06-06 15:30:46 UTC
Does this fix it (on both machines)?

Index: tree-ssa-strlen.c
===================================================================
--- tree-ssa-strlen.c	(revision 237069)
+++ tree-ssa-strlen.c	(working copy)
@@ -1867,6 +1867,8 @@ handle_builtin_memcmp (gimple_stmt_itera
     {
       gimple *ustmt = USE_STMT (use_p);
 
+      if (is_gimple_debug (ustmt))
+	continue;
       if (gimple_code (ustmt) == GIMPLE_ASSIGN)
 	{
 	  gassign *asgn = as_a <gassign *> (ustmt);
Comment 7 Eric Botcazou 2016-06-06 15:53:01 UTC
I can reproduce on IA-64.
Comment 8 Andreas Schwab 2016-06-06 18:39:38 UTC
That fixes the comparison failure on ia64.
Comment 9 Bernd Schmidt 2016-06-08 11:42:26 UTC
Author: bernds
Date: Wed Jun  8 11:41:54 2016
New Revision: 237208

URL: https://gcc.gnu.org/viewcvs?rev=237208&root=gcc&view=rev
Log:
	PR debug/71432
	PR ada/71413
	* tree-ssa-strlen.c (handle_builtin_memcmp): Ignore debug insns.

	* g++.dg/debug/pr71432.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/debug/pr71432.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-strlen.c
Comment 10 Bernd Schmidt 2016-06-09 16:28:29 UTC
Assuming fixed. Reopen if not.