Bug 45413 - gcc.target/i386/combine-mul.c fails on PIC targets
Summary: gcc.target/i386/combine-mul.c fails on PIC targets
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 10:51 UTC by Jack Howarth
Modified: 2011-03-07 18:10 UTC (History)
4 users (show)

See Also:
Host: x86_64-apple-darwin10
Target: x86_64-apple-darwin10
Build: x86_64-apple-darwin10
Known to work:
Known to fail:
Last reconfirmed: 2011-01-17 00:56:47


Attachments
assembly file for gcc.target/i386/combine-mul.c on x86_64-apple-darwin10 (626 bytes, text/plain)
2010-08-26 11:13 UTC, Jack Howarth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2010-08-26 10:51:35 UTC
The scan-assembler-not "12345" test in gcc.target/i386/combine-mul.c fails on x86_64-apple-darwin10 due to that target defaulting to -fPIC. Adding -fno-PIC eliminates the failure. This testcase needs...

Index: gcc.target/i386/combine-mul.c
===================================================================
--- gcc.target/i386/combine-mul.c	(revision 163561)
+++ gcc.target/i386/combine-mul.c	(working copy)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* { dg-require-effective-target nonpic } */
 /* { dg-final { scan-assembler-not "12345" } } */
 
 static inline unsigned int myrnd (void)
Comment 1 Bernd Schmidt 2010-08-26 10:57:44 UTC
Ok, I could apply that, but why is it failing?  What assembly output is being produced for it?
Comment 2 Jack Howarth 2010-08-26 11:13:19 UTC
Created attachment 21570 [details]
assembly file for gcc.target/i386/combine-mul.c on x86_64-apple-darwin10
Comment 3 mrs@gcc.gnu.org 2011-03-07 18:07:33 UTC
Author: mrs
Date: Mon Mar  7 18:07:31 2011
New Revision: 170744

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170744
Log:
2011-03-07  Jack Howarth <howarth@bromo.med.uc.edu>

	    PR target/45413
	    * gcc.target/i386/combine-mul.c: Require nonpic.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/combine-mul.c
Comment 4 mrs@gcc.gnu.org 2011-03-07 18:10:33 UTC
FIxed.

If there is a better incantation with:

  /* { dg-options "-O2 -fno-PIC" { target i?86-apple-darwin* } } */

I'd be interested, but I tried that version out and didn't see a pass.