Bug 23359 - [4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: use of .word
[4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: u...
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: target
4.1.0
: P5 minor
: 4.1.0
Assigned To: Andrew Pinski
http://gcc.gnu.org/ml/gcc-patches/200...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-12 18:08 UTC by Rainer Orth
Modified: 2006-02-06 18:49 UTC (History)
1 user (show)

See Also:
Host:
Target: i?86-*-solaris*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-29 00:32:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2005-08-12 18:08:30 UTC
Between 20050627 and 20050805, several C and C++ testcases begain to fail
on Solaris 10/x86 with the native as, e.g.

+FAIL: g++.old-deja/g++.brendan/crash63.C (test for excess errors)

Excess errors:
Assembler: crash63.C
	"/var/tmp//ccnloMW3.s", line 22 : Illegal mnemonic
	"/var/tmp//ccnloMW3.s", line 22 : Syntax error

Line 22 has

        .word   0x0b0f

which is from i386.md (trap).

This was introduced by this patch:

2005-07-21  Andrew Pinski  <pinskia@physics.uc.edu>

        * config/i386/i386.md (trap): Use "".word/t0x0b0f" instead of ud2.

http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01347.html

(Btw., the ChangeLog has two typos: double leading " and /t instead of \t)

One should be able to use .value instead (cf. ASM_SHORT in att.h, but
ASM_SHORT seems completely unused right now!?).  I've no idea how to do
this in the .md file, though.

Environment:
System: SunOS erebus 5.10 LAE_Preview i86pc i386 i86pc
Architecture: i86pc

	
host: i386-pc-solaris2.10
build: i386-pc-solaris2.10
target: i386-pc-solaris2.10
configured with: /vol/gnu/src/gcc/gcc-dist/configure --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls --disable-libssp --disable-multilib --with-gmp-dir=/vol/gnu/obj/gmp-4.1.3 --with-mpfr-dir=/vol/gnu/obj/gmp-4.1.3/mpfr --enable-languages=c,c++,f95,java,objc,ada --disable-libmudflap

How-To-Repeat:
Bootstrap mainline as above.
Comment 1 Rainer Orth 2005-08-12 18:11:13 UTC
Subject: Re:  New: Many Solaris 10/x86 testsuite failures with native as: use of .word

The same bug also affects libssp

/vol/gcc/obj/gcc-4.1.0-20050805/10-gcc/./gcc/xgcc -B/vol/gcc/obj/gcc-4.1.0-20050805/10-gcc/./gcc/ -B/vol/gcc/share/i386-pc-solaris2.10/bin/ -B/vol/gcc/share/i386-pc-solaris2.10/lib/ -isystem /vol/gcc/share/i386-pc-solaris2.10/include -isystem /vol/gcc/share/i386-pc-solaris2.10/sys-include -DHAVE_CONFIG_H -I. -I/vol/gnu/src/gcc/gcc-dist/libssp -I. -Wall -O2 -g -O2 -MT ssp.lo -MD -MP -MF .deps/ssp.Tpo -c /vol/gnu/src/gcc/gcc-dist/libssp/ssp.c  -fPIC -DPIC -o .libs/ssp.o
/vol/gnu/src/gcc/gcc-dist/libssp/ssp.c: In function '__stack_chk_fail_local':
/vol/gnu/src/gcc/gcc-dist/libssp/ssp.c:177: warning: visibility attribute not supported in this configuration; ignored
Assembler: ssp.c
	"/var/tmp//ccEjiHVN.s", line 138 : Illegal mnemonic
	"/var/tmp//ccEjiHVN.s", line 138 : Syntax error
make[3]: *** [ssp.lo] Error 1

and causes a bootstrap failure there.  It can be worked around using
--disable-libssp, though.

	Rainer
Comment 2 Andrew Pinski 2005-08-12 18:13:10 UTC
This is a bug in the native as, please report instead to the Sun.  Also we recomend gas on for Solaris 
x86.
Comment 3 Rainer Orth 2005-08-12 18:21:57 UTC
Subject: Re:  Many Solaris 10/x86 testsuite failures with native as: use of .word

pinskia at gcc dot gnu dot org writes:

> This is a bug in the native as, please report instead to the Sun.  Also we recomend gas on for Solaris 
> x86.

No, it is not: the Solaris/x86 as has .value instead of .word, as I
mentioned when referring to the various definitions of ASM_SHORT in the
i386 configurations.

While gas is recommended for Solaris 10/x86 and above for amd64 support,
until your patch to use .word the native as worked fine for 32-bit only
configurations (both on Solaris 10 and before where there is no amd64
support to care about), so the use of .word introduced a regression from
4.0.

	Rainer
Comment 4 Andrew Pinski 2005-08-12 18:22:39 UTC
I was not the first person to add .word to the .md file.

Does Solaris's as support ud2 instruction, if not then it was broken before my patch and I only started 
to fix up the problem.

Since you did not give the excat date, I don't know if your testing on 20050627 incuded:
2005-06-27  Richard Henderson  <rth@redhat.com> 
        
        * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New.
        (trap): Use ud2.

which broke it in the first place.
Comment 5 Rainer Orth 2005-08-12 18:34:15 UTC
Subject: Re:  Many Solaris 10/x86 testsuite failures with native as: use of .word

pinskia at gcc dot gnu dot org writes:

> I was not the first person to add .word to the .md file.

The only other use is in *tls_global_dynamic_64, which is only used for
amd64 and thus doesn't currently affect the Solaris assembler.

> Does Solaris's as support ud2 instruction, if not then it was broken before my patch and I only started 
> to fix up the problem.

It does, at least on Solaris 10/x86 which is the only system I currently
have access to: a minimal test case assembles and dis correctly shows the
ud2 instruction.

> Since you did not give the excat date, I don't know if your testing on 20050627 incuded:
> 2005-06-27  Richard Henderson  <rth@redhat.com> 
>         
>         * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New.
>         (trap): Use ud2.
> 
> which broke it in the first place.

The test-results submission

	http://gcc.gnu.org/ml/gcc-testresults/2005-06/msg01726.html

has

LAST_UPDATED: Mon Jun 27 10:42:42 UTC 2005

which should include the patch above according to cvs log:

revision 1.638
date: 2005/06/27 07:41:05;  author: jakub;  state: Exp;  lines: +77 -45
[...]
        * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New.
        (trap): Use ud2.

	Rainer
Comment 6 Andrew Pinski 2005-08-12 22:35:46 UTC
Maybe be it is time to remove support for the native assembler.
Comment 7 Andrew Pinski 2005-09-19 17:46:51 UTC
i?86-solaris is not a primary or a secondary target.
Comment 8 Rainer Orth 2006-01-31 19:36:19 UTC
Subject: Re:  [4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: use of .word


> pinskia at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>    Last reconfirmed|2005-10-25 20:15:55         |2006-01-29 00:32:05
>                date|                            |

Indeed: it caused a bootstrap attempt on 20060126 to verify the status of PR
bootstrap/21936 to fail building libssp.

Any suggestions on how to fix this (i.e. how to deal with slight
differences in assembler syntax for instructions/pseudo-ops)?

	Rainer
Comment 9 Andrew Pinski 2006-01-31 20:01:28 UTC
Can you try this patch:
Index: i386.md
===================================================================
--- i386.md     (revision 110427)
+++ i386.md     (working copy)
@@ -20199,7 +20199,9 @@
 (define_insn "trap"
   [(trap_if (const_int 1) (const_int 6))]
   ""
-  ".word\t0x0b0f"
+  {
+     return ASM_SHORT "0x0b0f";
+  }
   [(set_attr "length" "2")])
 
 (define_expand "sse_prologue_save"


I will try it on x86_64-linux-gnu as soon as my current/bootstrap is finished.
Comment 10 Rainer Orth 2006-01-31 20:08:01 UTC
Subject: Re:  [4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: use of .word

pinskia at gcc dot gnu dot org writes:

> Can you try this patch:

sure, bootstrap in progress.

Thanks.
	Rainer
Comment 11 Rainer Orth 2006-01-31 21:56:30 UTC
Subject: Re:  [4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: use of .word

A --disable-multilib (the amd64 doesn't yet work with Solaris as) bootstrap
with the native as completed successfully after disabling libffi/libjava
(due to PR libffi/26048), especially libssp built unlike before.  I cannot
currently run all dejagnu-based tests due to PR target/26051 ;-(

	Rainer

Comment 12 Rainer Orth 2006-02-01 19:00:33 UTC
Subject: Re:  [4.1/4.2 regression] Many Solaris 10/x86 testsuite failures with native as: use of .word

I've now tried this patch on the 4.1 branch, and many testsuite failures
due to missing .word support in Sun as are gone:

	http://gcc.gnu.org/ml/gcc-testresults/2006-02/msg00038.html

So the patch looks good.

Thanks.
	Rainer
Comment 13 Andrew Pinski 2006-02-01 19:12:43 UTC
Testing the fix on x86_64-linux-gnu.  Thanks for confirming it fixes the problems.

Sorry for breaking this in the first place.
Comment 14 Andrew Pinski 2006-02-02 14:58:38 UTC
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00130.html
Comment 15 Andrew Pinski 2006-02-06 18:39:34 UTC
Subject: Bug 23359

Author: pinskia
Date: Mon Feb  6 18:39:30 2006
New Revision: 110657

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110657
Log:
2006-02-06  Andrew Pinski  <pinskia@physics.uc.edu>

        PR target/23359
        * config/i386/i386.md (trap): Use ASM_SHORT instead of .word.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.md

Comment 16 Andrew Pinski 2006-02-06 18:49:08 UTC
Subject: Bug 23359

Author: pinskia
Date: Mon Feb  6 18:49:05 2006
New Revision: 110660

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110660
Log:
2006-02-06  Andrew Pinski  <pinskia@physics.uc.edu>

        PR target/23359
        * config/i386/i386.md (trap): Use ASM_SHORT instead of .word.



Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/i386/i386.md

Comment 17 Andrew Pinski 2006-02-06 18:49:28 UTC
Fixed, sorry for causing this in the first place.