All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nix <nix@esperi.org.uk>
To: BlaisorBlade <blaisorblade_spam@yahoo.it>
Cc: uml <uml@dot1q.net>, roland <for_spam@gmx.de>,
	uml-user <user-mode-linux-user@lists.sourceforge.net>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Re: [uml-user] SuSE 9.1 host + 2.4.26 Kernel + GCC 3.3.3 similarities to 2.6.6!?
Date: Tue, 15 Jun 2004 07:20:14 +0100	[thread overview]
Message-ID: <87oenle40x.fsf@amaterasu.srvr.nix> (raw)
In-Reply-To: <200406142109.45156.blaisorblade_spam@yahoo.it> (BlaisorBlade's message of "Mon, 14 Jun 2004 21:09:45 +0200")

On Mon, 14 Jun 2004, BlaisorBlade mused:
> Alle 23:58, domenica 13 giugno 2004, Nix ha scritto:
>> On Sun, 06 Jun 2004, uml@dot1q.net stipulated:
>> > Switch differences between -O1 and -O2 on GCC 3.3.3:
>>
>> Note: -O{n} are *not* the equivalent of groups of -f switches:
>> they turn those switches on, but other things inside the compiler
>> are directly triggered by the optimization level.
> 
> I expected that SuSE 9.1 shipped a buggy gcc, but I didn't found any confirm 
> to this (I remember they did such things in the past). However the fact that 
> the compiler output that dump is anyway a compiler bug...

Oh, yes, certainly.

> Well, ok, more hints, the first possible answer to this one seems to be that 
> SuSE enables -funit-at-a-time:

(unsurprising, given that -funit-at-a-time's primary author is jh@suse ;} )

> http://www.google.com/search?q=%22SuSE+9.1%22+bug+gcc&sourceid=opera&num=25&ie=utf-8&oe=utf-8
> 
> I checked the first hit (read the whole thread):
> 
> http://gcc.gnu.org/ml/gcc-bugs/2004-05/msg01912.html

Yep, -funit-at-a-time will definitely break kernels that aren't
expecting it, both because of elision of unused statics and because some
arches depend on emission of asm's at the top level to emit stuff in the
same order in generated code, and with -funit-at-a-time this just
doesn't happen anymore. (I don't think i386 is such an architecture,
though.)

-funit-at-a-time is enabled by default for C and C++ in GCC 3.4.

> This is the trick:
> "#define ATTRIBUTE_USED
> #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >=4)
> #undef ATTRIBUTE_USED
> #define ATTRIBUTE_USED __attribute__((used))
> #endif

The sort of thing you want to stash away in a header file and never lay
eyes on again. :)

> static const int hello ATTRIBUTE_USED  = 56;
> 
> int main()
> {
>         asm(
>         "mov hello, %eax\n"
>         );

Well, in this *specific* case, hello should be marked as clobbered,
which will also stop the compiler eliding it. But this *was* a contrived
testcase...

-- 
`We in no way believe that this Christ was a space alien.'
                    --- A creationist website goes completely bonkers


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2004-06-15  6:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-06 18:54 [uml-devel] Re: [uml-user] SuSE 9.1 host + 2.4.26 Kernel + GCC 3.3.3 similarities to 2.6.6!? roland
2004-06-06 21:33 ` uml
2004-06-07  3:37   ` uml
2004-06-13 21:58     ` Nix
2004-06-14 19:09       ` BlaisorBlade
2004-06-15  6:20         ` Nix [this message]
2004-06-16 19:09           ` BlaisorBlade
2004-06-17 15:35             ` uml
2004-06-17 17:25               ` BlaisorBlade
2004-06-17 18:10                 ` uml
2004-06-17 18:46                   ` BlaisorBlade
2004-06-17 20:00                     ` uml
2004-06-18 19:08                       ` [uml-devel] Re: [uml-user] SuSE 9.1 host + 2.4.26 Kernel + GCC 3.3.3 similarities to 2.6.6!? (2.6.7 additionally!) uml
2004-06-17 18:52             ` [uml-devel] Re: [uml-user] SuSE 9.1 host + 2.4.26 Kernel + GCC 3.3.3 similarities to 2.6.6!? Nix
     [not found] <007701c44be9$e4d7d630$dd02a8c0@ferraro>
2004-06-06 18:22 ` roland
2004-06-06 20:04   ` uml

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oenle40x.fsf@amaterasu.srvr.nix \
    --to=nix@esperi.org.uk \
    --cc=blaisorblade_spam@yahoo.it \
    --cc=for_spam@gmx.de \
    --cc=uml@dot1q.net \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.