public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
@ 2014-02-11 19:28 H.J. Lu
  2014-02-11 19:41 ` Uros Bizjak
  2014-02-11 19:41 ` Rainer Orth
  0 siblings, 2 replies; 8+ messages in thread
From: H.J. Lu @ 2014-02-11 19:28 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak

Hi,

HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
We already pass --32 to assembler on x86.  It should be OK to do it
in configure.  OK for trunk?

Thanks.

H.J.
---
2014-02-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/60151
	* configure.ac (HAVE_AS_GOTOFF_IN_DATA): Pass --32 to assembler.
	* configure: Regenerated.

diff --git a/gcc/configure.ac b/gcc/configure.ac
index ac3d842..0aafbc9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3868,7 +3868,7 @@ foo:	nop
     # These two are used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],
-        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+        gcc_cv_as_ix86_gotoff_in_data, [2,11,0], --32,
 [	.text
 .L0:
 	nop

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 19:28 PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64 H.J. Lu
@ 2014-02-11 19:41 ` Uros Bizjak
  2014-02-11 19:41 ` Rainer Orth
  1 sibling, 0 replies; 8+ messages in thread
From: Uros Bizjak @ 2014-02-11 19:41 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Tue, Feb 11, 2014 at 8:28 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
> We already pass --32 to assembler on x86.  It should be OK to do it
> in configure.  OK for trunk?

Unfortunately, .code32 didn't work as expected...

So, OK.

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 19:28 PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64 H.J. Lu
  2014-02-11 19:41 ` Uros Bizjak
@ 2014-02-11 19:41 ` Rainer Orth
  2014-02-11 20:03   ` H.J. Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Rainer Orth @ 2014-02-11 19:41 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches, Uros Bizjak

Hi H.J.,

> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
> We already pass --32 to assembler on x86.  It should be OK to do it
> in configure.  OK for trunk?

This would break Solaris/x86 with as configurations, where this test
currently passes, but would fail since as doesn't understand --32.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 19:41 ` Rainer Orth
@ 2014-02-11 20:03   ` H.J. Lu
  2014-02-11 20:29     ` Rainer Orth
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2014-02-11 20:03 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Uros Bizjak

On Tue, Feb 11, 2014 at 11:40 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Hi H.J.,
>
>> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
>> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
>> We already pass --32 to assembler on x86.  It should be OK to do it
>> in configure.  OK for trunk?
>
> This would break Solaris/x86 with as configurations, where this test
> currently passes, but would fail since as doesn't understand --32.
>

How about passing --32 to as only for Linux?  OK to install?

Thanks.


-- 
H.J.
---
2014-02-11  H.J. Lu  <hongjiu.lu@intel.com>

PR target/60151
* configure.ac (HAVE_AS_GOTOFF_IN_DATA): Pass --32 to assembler
for Linux target.
* configure: Regenerated.

diff --git a/gcc/configure.ac b/gcc/configure.ac
index ac3d842..1b5dca2 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3867,8 +3867,17 @@ foo: nop

     # These two are used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
+    case $target_os in
+    linux*)
+      as_ix86_gotoff_in_data_opt="--32"
+      ;;
+    *)
+      as_ix86_gotoff_in_data_opt=
+      ;;
+    esac
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],
-        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],
+ $as_ix86_gotoff_in_data_opt,
 [ .text
 .L0:
  nop

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 20:03   ` H.J. Lu
@ 2014-02-11 20:29     ` Rainer Orth
  2014-02-11 20:41       ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Rainer Orth @ 2014-02-11 20:29 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GCC Patches, Uros Bizjak

"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Tue, Feb 11, 2014 at 11:40 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> Hi H.J.,
>>
>>> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
>>> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
>>> We already pass --32 to assembler on x86.  It should be OK to do it
>>> in configure.  OK for trunk?
>>
>> This would break Solaris/x86 with as configurations, where this test
>> currently passes, but would fail since as doesn't understand --32.
>>
>
> How about passing --32 to as only for Linux?  OK to install?

I'd rather do it for gas instead, which can be used on non-Linux
systems, too.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 20:29     ` Rainer Orth
@ 2014-02-11 20:41       ` H.J. Lu
  2014-02-12  8:20         ` Uros Bizjak
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2014-02-11 20:41 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Uros Bizjak

On Tue, Feb 11, 2014 at 12:29 PM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Tue, Feb 11, 2014 at 11:40 AM, Rainer Orth
>> <ro@cebitec.uni-bielefeld.de> wrote:
>>> Hi H.J.,
>>>
>>>> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
>>>> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
>>>> We already pass --32 to assembler on x86.  It should be OK to do it
>>>> in configure.  OK for trunk?
>>>
>>> This would break Solaris/x86 with as configurations, where this test
>>> currently passes, but would fail since as doesn't understand --32.
>>>
>>
>> How about passing --32 to as only for Linux?  OK to install?
>
> I'd rather do it for gas instead, which can be used on non-Linux
> systems, too.
>

Sure.  Here is the new patch.  OK to install?

-- 
H.J.
---
2014-02-11  H.J. Lu  <hongjiu.lu@intel.com>

PR target/60151
* configure.ac (HAVE_AS_GOTOFF_IN_DATA): Pass --32 to GNU assembler.
* configure: Regenerated.

diff --git a/gcc/configure.ac b/gcc/configure.ac
index ac3d842..333bca6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3867,8 +3867,14 @@ foo: nop

     # These two are used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
+    if test x"$gas" = x"yes"; then
+      as_ix86_gotoff_in_data_opt="--32"
+    else
+      as_ix86_gotoff_in_data_opt=
+    fi
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],
-        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],
+ $as_ix86_gotoff_in_data_opt,
 [ .text
 .L0:
  nop

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-11 20:41       ` H.J. Lu
@ 2014-02-12  8:20         ` Uros Bizjak
  2014-02-12 16:13           ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2014-02-12  8:20 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Rainer Orth, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

On Tue, Feb 11, 2014 at 9:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>>>> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
>>>>> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
>>>>> We already pass --32 to assembler on x86.  It should be OK to do it
>>>>> in configure.  OK for trunk?
>>>>
>>>> This would break Solaris/x86 with as configurations, where this test
>>>> currently passes, but would fail since as doesn't understand --32.
>>>>
>>>
>>> How about passing --32 to as only for Linux?  OK to install?
>>
>> I'd rather do it for gas instead, which can be used on non-Linux
>> systems, too.
>>
>
> Sure.  Here is the new patch.  OK to install?

Attached is slightly changed patch that follows established
configure.ac code formatting. Please check if this version works for
you.

The patch is OK for mainline and release branches.

Thanks,
Uros.

[-- Attachment #2: c.diff.txt --]
[-- Type: text/plain, Size: 1617 bytes --]

Index: configure
===================================================================
--- configure	(revision 207710)
+++ configure	(working copy)
@@ -25028,6 +25028,10 @@
 
     # These two are used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
+    as_ix86_gotoff_in_data_opt=
+    if test x$gas = xyes; then
+      as_ix86_gotoff_in_data_opt="--32"
+    fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for GOTOFF in data" >&5
 $as_echo_n "checking assembler for GOTOFF in data... " >&6; }
 if test "${gcc_cv_as_ix86_gotoff_in_data+set}" = set; then :
@@ -25044,7 +25048,7 @@
 	nop
 	.data
 	.long .L0@GOTOFF' > conftest.s
-    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags $as_ix86_gotoff_in_data_opt -o conftest.o conftest.s >&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
Index: configure.ac
===================================================================
--- configure.ac	(revision 207710)
+++ configure.ac	(working copy)
@@ -3867,8 +3867,13 @@
 
     # These two are used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
+    as_ix86_gotoff_in_data_opt=
+    if test x$gas = xyes; then
+      as_ix86_gotoff_in_data_opt="--32"
+    fi
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],
-        gcc_cv_as_ix86_gotoff_in_data, [2,11,0],,
+      gcc_cv_as_ix86_gotoff_in_data, [2,11,0],
+      [$as_ix86_gotoff_in_data_opt],
 [	.text
 .L0:
 	nop

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64
  2014-02-12  8:20         ` Uros Bizjak
@ 2014-02-12 16:13           ` H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 2014-02-12 16:13 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Rainer Orth, GCC Patches

On Wed, Feb 12, 2014 at 12:20 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Feb 11, 2014 at 9:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>>>> HAVE_AS_GOTOFF_IN_DATA defines a 32-bit assembler feature, we need to
>>>>>> pass --32 to assembler. Otherwise, we get the wrong result on x86-64.
>>>>>> We already pass --32 to assembler on x86.  It should be OK to do it
>>>>>> in configure.  OK for trunk?
>>>>>
>>>>> This would break Solaris/x86 with as configurations, where this test
>>>>> currently passes, but would fail since as doesn't understand --32.
>>>>>
>>>>
>>>> How about passing --32 to as only for Linux?  OK to install?
>>>
>>> I'd rather do it for gas instead, which can be used on non-Linux
>>> systems, too.
>>>
>>
>> Sure.  Here is the new patch.  OK to install?
>
> Attached is slightly changed patch that follows established
> configure.ac code formatting. Please check if this version works for
> you.
>
> The patch is OK for mainline and release branches.
>

I checked it into trunk and will backport it later.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-12 16:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11 19:28 PATCH: PR target/60151: HAVE_AS_GOTOFF_IN_DATA is mis-detected on x86-64 H.J. Lu
2014-02-11 19:41 ` Uros Bizjak
2014-02-11 19:41 ` Rainer Orth
2014-02-11 20:03   ` H.J. Lu
2014-02-11 20:29     ` Rainer Orth
2014-02-11 20:41       ` H.J. Lu
2014-02-12  8:20         ` Uros Bizjak
2014-02-12 16:13           ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).