public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -malign-double switch patch?
@ 2002-08-08 14:09 Davis, Bryan
  2002-08-09 15:35 ` Richard Henderson
  0 siblings, 1 reply; 9+ messages in thread
From: Davis, Bryan @ 2002-08-08 14:09 UTC (permalink / raw)
  To: gcc

Hi,
I am having the same problem as a few others with the gcc -malign-double switch and the fstream seg fault thing.

Is there a patch or work-around out there?

This is causing us big problems.

Thanks
Bryan

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

* Re: -malign-double switch patch?
  2002-08-08 14:09 -malign-double switch patch? Davis, Bryan
@ 2002-08-09 15:35 ` Richard Henderson
  2002-08-09 18:32   ` Nix
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2002-08-09 15:35 UTC (permalink / raw)
  To: Davis, Bryan; +Cc: gcc

On Thu, Aug 08, 2002 at 05:08:31PM -0400, Davis, Bryan wrote:
> I am having the same problem as a few others with the gcc -malign-double
> switch and the fstream seg fault thing.

Apparently you didn't read the documentation, in which it is said
that the switch affects the abi, and therefore should be used only
with extreme caution under controled conditions.

> This is causing us big problems.

Don't use it.


r~

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

* Re: -malign-double switch patch?
  2002-08-09 15:35 ` Richard Henderson
@ 2002-08-09 18:32   ` Nix
  2002-08-10 18:12     ` Jamie Lokier
  0 siblings, 1 reply; 9+ messages in thread
From: Nix @ 2002-08-09 18:32 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Davis, Bryan, gcc

On Fri, 9 Aug 2002, Richard Henderson muttered drunkenly:
> On Thu, Aug 08, 2002 at 05:08:31PM -0400, Davis, Bryan wrote:
>> I am having the same problem as a few others with the gcc -malign-double
>> switch and the fstream seg fault thing.
> 
> Apparently you didn't read the documentation, in which it is said
> that the switch affects the abi, and therefore should be used only
> with extreme caution under controled conditions.

GCC-3.1.x's manual says

,----
| `-malign-double'
| `-mno-align-double'
|      Control whether GCC aligns `double', `long double', and `long
|      long' variables on a two word boundary or a one word boundary.
|      Aligning `double' variables on a two word boundary will produce
|      code that runs somewhat faster on a `Pentium' at the expense of
|      more memory.
`----

i.e., it doesn't mention the ABI breakage :( perhaps this is only in the
trunk...

-- 
`There's something satisfying about killing JWZ over and over again.'
                                        -- 1i, personal communication

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

* Re: -malign-double switch patch?
  2002-08-09 18:32   ` Nix
@ 2002-08-10 18:12     ` Jamie Lokier
  2002-08-10 21:26       ` Ross Smith
  2002-08-10 22:24       ` Richard Henderson
  0 siblings, 2 replies; 9+ messages in thread
From: Jamie Lokier @ 2002-08-10 18:12 UTC (permalink / raw)
  To: Nix; +Cc: Richard Henderson, Davis, Bryan, gcc

Nix wrote:
> > Apparently you didn't read the documentation, in which it is said
> > that the switch affects the abi, and therefore should be used only
> > with extreme caution under controled conditions.
> 
> GCC-3.1.x's manual says
> 
> ,----
> | `-malign-double'
> | `-mno-align-double'
> |      Control whether GCC aligns `double', `long double', and `long
> |      long' variables on a two word boundary or a one word boundary.
> |      Aligning `double' variables on a two word boundary will produce
> |      code that runs somewhat faster on a `Pentium' at the expense of
> |      more memory.
> `----
> 
> i.e., it doesn't mention the ABI breakage :( perhaps this is only in the
> trunk...

The next paragraph says:

     *Warning:* if you use the `-malign-double' switch, structures
     containing the above types will be aligned differently than the
     published application binary interface specifications for the 386.

Now, if you're not using structures, perhaps it isn't obvious that you
can still have ABI breakage...  (Argument alignment on the stack
changes, doesn't it?)

-- Jamie

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

* Re: -malign-double switch patch?
  2002-08-10 18:12     ` Jamie Lokier
@ 2002-08-10 21:26       ` Ross Smith
  2002-08-10 22:25         ` Richard Henderson
  2002-08-10 22:24       ` Richard Henderson
  1 sibling, 1 reply; 9+ messages in thread
From: Ross Smith @ 2002-08-10 21:26 UTC (permalink / raw)
  To: Jamie Lokier, Nix; +Cc: Richard Henderson, Davis, Bryan, gcc

On Sunday, 11 August 2002 13:11, Jamie Lokier wrote:
> Nix wrote:
> > > Apparently you didn't read the documentation, in which it is said
> > > that the switch affects the abi, and therefore should be used
> > > only with extreme caution under controled conditions.
> >
> > GCC-3.1.x's manual says
> >
> > ,----
> >
> > | `-malign-double'
> > | `-mno-align-double'
> > |      Control whether GCC aligns `double', `long double', and
> > | `long long' variables on a two word boundary or a one word
> > | boundary. Aligning `double' variables on a two word boundary will
> > | produce code that runs somewhat faster on a `Pentium' at the
> > | expense of more memory.
> >
> > `----
> >
> > i.e., it doesn't mention the ABI breakage :( perhaps this is only
> > in the trunk...
>
> The next paragraph says:
>
>      *Warning:* if you use the `-malign-double' switch, structures
>      containing the above types will be aligned differently than the
>      published application binary interface specifications for the
> 386.

No it doesn't. The next paragraph is the description of the 
-m128bit-long-double option, which does have a warning similar to that.
But there's nothing to indicate that the same warning applies to 
-malign-double. (This is in the 3.1 docs; as Nix said, the current 
development version may have something different.)

-- 
Ross Smith ..................................... Auckland, New Zealand
r-smith@ihug.co.nz ...................................................

        "A specter is haunting Wall Street; it is the specter
        of honest accounting."           -- Arthur D. Hlavaty

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

* Re: -malign-double switch patch?
  2002-08-10 18:12     ` Jamie Lokier
  2002-08-10 21:26       ` Ross Smith
@ 2002-08-10 22:24       ` Richard Henderson
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2002-08-10 22:24 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: Nix, Davis, Bryan, gcc

On Sun, Aug 11, 2002 at 02:11:11AM +0100, Jamie Lokier wrote:
> Now, if you're not using structures, perhaps it isn't obvious that you
> can still have ABI breakage...  (Argument alignment on the stack
> changes, doesn't it?)

Stack alignment doesn't change, iirc.  But are you absolutely positively
sure you aren't using structures somewhere?  I wouldn't bet on it.  I bet
there's a 64-bit integer type (e.g. off_t) somewhere in the fstream
structure that's being layed out differently.


r~

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

* Re: -malign-double switch patch?
  2002-08-10 21:26       ` Ross Smith
@ 2002-08-10 22:25         ` Richard Henderson
  2002-08-11  6:58           ` Ross Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2002-08-10 22:25 UTC (permalink / raw)
  To: Ross Smith; +Cc: Jamie Lokier, Nix, Davis, Bryan, gcc

On Sun, Aug 11, 2002 at 04:29:52PM +1200, Ross Smith wrote:
> No it doesn't. The next paragraph is the description of the 
> -m128bit-long-double option, which does have a warning similar to that.
> But there's nothing to indicate that the same warning applies to 
> -malign-double.

*Both* options bear that warning.  The warning appears twice.

> (This is in the 3.1 docs; as Nix said, the current 
> development version may have something different.)

I'm looking at the 3.1.1 docs.


r~

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

* Re: -malign-double switch patch?
  2002-08-10 22:25         ` Richard Henderson
@ 2002-08-11  6:58           ` Ross Smith
  2002-08-11  7:36             ` Jamie Lokier
  0 siblings, 1 reply; 9+ messages in thread
From: Ross Smith @ 2002-08-11  6:58 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Jamie Lokier, Nix, Davis, Bryan, gcc

On Sunday, 11 August 2002 17:25, Richard Henderson wrote:
> On Sun, Aug 11, 2002 at 04:29:52PM +1200, Ross Smith wrote:
> > No it doesn't. The next paragraph is the description of the
> > -m128bit-long-double option, which does have a warning similar to
> > that. But there's nothing to indicate that the same warning applies
> > to -malign-double.
>
> *Both* options bear that warning.  The warning appears twice.
>
> > (This is in the 3.1 docs; as Nix said, the current
> > development version may have something different.)
>
> I'm looking at the 3.1.1 docs.

I just checked the archived docs on the GCC website. The warning was 
added between 3.1 and 3.1.1.

-- 
Ross Smith ..................................... Auckland, New Zealand
r-smith@ihug.co.nz ...................................................

        "A specter is haunting Wall Street; it is the specter
        of honest accounting."           -- Arthur D. Hlavaty

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

* Re: -malign-double switch patch?
  2002-08-11  6:58           ` Ross Smith
@ 2002-08-11  7:36             ` Jamie Lokier
  0 siblings, 0 replies; 9+ messages in thread
From: Jamie Lokier @ 2002-08-11  7:36 UTC (permalink / raw)
  To: Ross Smith; +Cc: Richard Henderson, Nix, Davis, Bryan, gcc

Ross Smith wrote:
> > I'm looking at the 3.1.1 docs.
> 
> I just checked the archived docs on the GCC website. The warning was 
> added between 3.1 and 3.1.1.

I'm looking at Red Hat's gcc-3.1-4, which does have the warning.
That same manual begins:

    This manual documents how to use the GNU compilers, as well as their
    features and incompatibilities, and how to report bugs.  It corresponds
    to GCC version 3.1.

So I can be forgiven for thinking the warning applies to 3.1 :-)

I'm surprised by one thing: doesn't the stack layout for function calls
change with `-malign-double'?

-- Jamie

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

end of thread, other threads:[~2002-08-11  7:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-08 14:09 -malign-double switch patch? Davis, Bryan
2002-08-09 15:35 ` Richard Henderson
2002-08-09 18:32   ` Nix
2002-08-10 18:12     ` Jamie Lokier
2002-08-10 21:26       ` Ross Smith
2002-08-10 22:25         ` Richard Henderson
2002-08-11  6:58           ` Ross Smith
2002-08-11  7:36             ` Jamie Lokier
2002-08-10 22:24       ` Richard Henderson

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).