Subject: 2.6-test2: gcc-3.3.1 warning.


Hi all,

I'm getting this warning while compiling the 2.6-tes2:

arch/i386/kernel/reboot.c: In function `machine_restart':
arch/i386/kernel/reboot.c:261: warning: use of memory input without
lvalue in asm operand 0 is deprecated

--
Luiz Fernando N. Capitulino

<[email protected]>
<http://www.telecentros.sp.gov.br>


2003-07-28 20:34:20

by Randy.Dunlap

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

On 28 Jul 2003 09:40:53 -0300 Luiz Capitulino <[email protected]> wrote:

|
| Hi all,
|
| I'm getting this warning while compiling the 2.6-tes2:
|
| arch/i386/kernel/reboot.c: In function `machine_restart':
| arch/i386/kernel/reboot.c:261: warning: use of memory input without
| lvalue in asm operand 0 is deprecated

What version of gcc?
I don't see this with gcc 3.2.
Is this something that we need to fix?

--
~Randy

2003-07-28 22:50:26

by Tomas Szepe

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

> [[email protected]]
>
> Subject: Re: 2.6-test2: gcc-3.3.1 warning.

There's no such release as gcc-3.3.1.

--
Tomas Szepe <[email protected]>

2003-07-29 00:22:44

by Kurt Wall

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

Quoth Tomas Szepe:
> > [[email protected]]
> >
> > Subject: Re: 2.6-test2: gcc-3.3.1 warning.
>
> There's no such release as gcc-3.3.1.

A snapshot known as 3.3.1 was released on July 20.

Kurt
--
"It's kind of fun to do the impossible."
-- Walt Disney

2003-07-29 04:55:51

by Tomas Szepe

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

> [[email protected]]
>
> Quoth Tomas Szepe:
> > > [[email protected]]
> > >
> > > Subject: Re: 2.6-test2: gcc-3.3.1 warning.
> >
> > There's no such release as gcc-3.3.1.
>
> A snapshot known as 3.3.1 was released on July 20.

Are you trying to argue that it's ok to call a snapshot
a "name" an actual release will bear in the (not so distant)
future?

--
Tomas Szepe <[email protected]>

2003-07-29 09:29:03

by J.A. Magallon

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.


On 07.29, Tomas Szepe wrote:
> > [[email protected]]
> >
> > Quoth Tomas Szepe:
> > > > [[email protected]]
> > > >
> > > > Subject: Re: 2.6-test2: gcc-3.3.1 warning.
> > >
> > > There's no such release as gcc-3.3.1.
> >
> > A snapshot known as 3.3.1 was released on July 20.
>
> Are you trying to argue that it's ok to call a snapshot
> a "name" an actual release will bear in the (not so distant)
> future?
>

Oh, plz...
Then why are we all calling current kernel 2.4.22 instead of 2.4.21.90 ?
(thing that I would prefer...) ?
OK, the full name would be gcc-3.3.1-prerelease-of-20030720.
But the version comes from the gcc people, the distro did not choose it.
It is clear if it is the 3.4 or the 3.3.1 branch.
If gcc people has decided to deprecate a feature, live with it and
correct the kernel source. Same happened with multiline string literals.
This is no strange compiler, it is just the next gcc you will see.

--
J.A. Magallon <[email protected]> \ Software is
like sex:
werewolf.able.es \ It's better when
it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre8-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.6mdk))

2003-07-29 09:36:52

by Tomas Szepe

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

> On 07.29, Tomas Szepe wrote:
>
> Then why are we all calling current kernel 2.4.22 instead of 2.4.21.90 ?

WE aren't.

http://www.kerne.org:
The latest stable version of the Linux kernel is: 2.4.21
The latest prepatch for the stable Linux kernel tree is: 2.4.22-pre8
The latest snapshot for the stable Linux kernel tree is: 2.4.21-bk20

> OK, the full name would be gcc-3.3.1-prerelease-of-20030720.

Yeah, it doesn't really surprise me it's all the same to Mandrake people.

--
Tomas Szepe <[email protected]>

2003-07-29 10:20:43

by Tomas Szepe

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

> [[email protected]]
>
> > Does Mandrake also ship "stable" distributions w/ kernels compiled using
> > gcc 3.3-whatever or is that idiocy suse-specific?
>
> Tell me a distro that ships pristine http://www.kernel.org kernels o release
> gcc's, without any 'backported patch from xxx-1234 to correct PR1234'.

Slackware (whenever possible).

> What is the difference between backporting a patch from 3.3.1-pre to 3.3,
> and using 3.3.1-pre directly ? Ah, that you get less bug corrected.

Large. 3.3 is a development series. It DOES introduce new stuff.

In production environments you definitely want to stick with 3.2.3
or (better yet) 2.95.3.

$ head -4 Makefile
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 22
EXTRAVERSION = -pre8
$ grep 'recommended compiler' Documentation/Changes
The recommended compiler for the kernel is gcc 2.95.x (x >= 3), and it

> And no, at least in my case, this is not a stable Mandrake, it is Cooker,
> the equivalent of RawHide. Latest stable shiped a kernel built with 3.2.3,

Ok.

--
Tomas Szepe <[email protected]>

2003-07-29 09:59:36

by Tomas Szepe

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

> [[email protected]]
>
> > The latest prepatch for the stable Linux kernel tree is: 2.4.22-pre8
>
> So what it this -------------------------------------------^^^^^^ ??

Does your screen only have 63 columns?

> If people talks to you about 2.4.22, sure you understand at the first
> glance tyey talk about the -pre of 2.4.22.

Try submitting a bug report that reads "there's this and this problem
in 2.4.22." One of the first questions you are bound to be asked is
"could you clarify the version you're seeing the problem with?"

> I hope you just use release kernels, -pres are only for Mandrake people ;)

Does Mandrake also ship "stable" distributions w/ kernels compiled using
gcc 3.3-whatever or is that idiocy suse-specific?

> I would understand you if it were a bug in the compiler, if it it cried
> against obviously correct code, but it just says
> that the assembler syntax is old and you should change it.

So far I said nothing about the problem itself; all the time I'm merely
trying to point out that it's dreadfully unreasonable to pretend that
there's a gcc 3.3.1.

> Linux 2.4.22-pre8-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.6mdk))

Right.

--
Tomas Szepe <[email protected]>

2003-07-29 09:50:35

by J.A. Magallon

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.


On 07.29, Tomas Szepe wrote:
> > On 07.29, Tomas Szepe wrote:
> >
> > Then why are we all calling current kernel 2.4.22 instead of
2.4.21.90 ?
>
> WE aren't.
>
> http://www.kerne.org:
> The latest stable version of the Linux kernel is: 2.4.21
> The latest prepatch for the stable Linux kernel tree is: 2.4.22-pre8

So what it this -------------------------------------------^^^^^^ ??
If people talks to you about 2.4.22, sure you understand at the first
glance tyey talk about the -pre of 2.4.22.

> The latest snapshot for the stable Linux kernel tree is: 2.4.21-bk20
>
> > OK, the full name would be gcc-3.3.1-prerelease-of-20030720.
>
> Yeah, it doesn't really surprise me it's all the same to Mandrake
people.
>

What about Mandrake people ? Whats wrong with testing prerelease
software ?
I hope you just use release kernels, -pres are only for Mandrake people
;)
I would understand you if it were a bug in the compiler, if it it cried
against obviously correct code, but it just says
that the assembler syntax is old and you should change it.

Any ways, let it be. You just will have to hurry when real 3.3.1 or 3.4
gets out, and then two thousand people complaint instead of two couples.

--
J.A. Magallon <[email protected]> \ Software is
like sex:
werewolf.able.es \ It's better when
it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre8-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.6mdk))

2003-07-29 10:11:31

by J.A. Magallon

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.


On 07.29, Tomas Szepe wrote:
[...]
>
> Does Mandrake also ship "stable" distributions w/ kernels compiled
using
> gcc 3.3-whatever or is that idiocy suse-specific?
>

Tell me a distro that ships pristine http://www.kernel.org kernels o release
gcc's,
without any 'backported patch from xxx-1234 to correct PR1234'. What is
the difference between backporting a patch from 3.3.1-pre to 3.3, and
using 3.3.1-pre directly ? Ah, that you get less bug corrected.

And no, at least in my case, this is not a stable Mandrake, it is
Cooker,
the equivalent of RawHide. Latest stable shiped a kernel built with
3.2.3,
and current cooker builds kernels with 3.3.1. And bugs are discovered
and
fixed. What's bad ?

--
J.A. Magallon <[email protected]> \ Software is
like sex:
werewolf.able.es \ It's better when
it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre8-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.6mdk))

2003-07-29 12:07:01

by Alan

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

On Maw, 2003-07-29 at 11:20, Tomas Szepe wrote:
> > What is the difference between backporting a patch from 3.3.1-pre to 3.3,
> > and using 3.3.1-pre directly ? Ah, that you get less bug corrected.
>
> Large. 3.3 is a development series. It DOES introduce new stuff.
>
> In production environments you definitely want to stick with 3.2.3
> or (better yet) 2.95.3.

3.2 is probably the best, but lots of people are using gcc 3.3 to build
kernels and so far all the things we've hit have been the stricter
parser throwing up on technically invalid C in the kernel source/

2003-07-29 12:34:51

by Jakub Jelinek

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

On Tue, Jul 29, 2003 at 12:20:07PM +0200, Tomas Szepe wrote:
> > What is the difference between backporting a patch from 3.3.1-pre to 3.3,
> > and using 3.3.1-pre directly ? Ah, that you get less bug corrected.
>
> Large. 3.3 is a development series. It DOES introduce new stuff.

That's incorrect. gcc-3_3-branch is stable branch, the difference between
3.3 and 3.3.1-pre is mostly bugfixes. Of course, some new things appear
on the branch from time to time, but it is very different from GCC trunk
where development occurs.
gcc-3_2-branch does not introduce any new stuff, since similarly
to gcc-2_95-branch is dead (only gcc-3_2-rhl8-branch is maintained still).

Jakub

2003-07-29 15:38:37

by Randy.Dunlap

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

On 29 Jul 2003 12:57:52 +0100 Alan Cox <[email protected]> wrote:

| On Maw, 2003-07-29 at 11:20, Tomas Szepe wrote:
| > > What is the difference between backporting a patch from 3.3.1-pre to 3.3,
| > > and using 3.3.1-pre directly ? Ah, that you get less bug corrected.
| >
| > Large. 3.3 is a development series. It DOES introduce new stuff.
| >
| > In production environments you definitely want to stick with 3.2.3
| > or (better yet) 2.95.3.
|
| 3.2 is probably the best, but lots of people are using gcc 3.3 to build
| kernels and so far all the things we've hit have been the stricter
| parser throwing up on technically invalid C in the kernel source/

I really hate to get this back to the original problem, but is
the reported warning a gcc 3.3.x problem? I don't see the assembly
problem here.

| arch/i386/kernel/reboot.c: In function `machine_restart':
| arch/i386/kernel/reboot.c:261: warning: use of memory input without
| lvalue in asm operand 0 is deprecated

--
~Randy

2003-08-17 01:26:38

by Richard Henderson

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

On Tue, Jul 29, 2003 at 08:35:07AM -0700, Randy.Dunlap wrote:
> I really hate to get this back to the original problem, but is
> the reported warning a gcc 3.3.x problem? I don't see the assembly
> problem here.
>
> | arch/i386/kernel/reboot.c: In function `machine_restart':
> | arch/i386/kernel/reboot.c:261: warning: use of memory input without
> | lvalue in asm operand 0 is deprecated


static long no_idt[2];
...
__asm__ __volatile__("lidt %0": :"m" (no_idt));

Notice that no_idt is an array. Therefore its identifier decays
into a pointer. Therefore, what this statement is really asking
for is

{
long *tmp = no_idt;
asm volatile ("lidt %0" : : "m" (*&tmp));
}

which is clearly not what was intended.

Fixed by doing

__asm__ __volatile__("lidt %0": :"m" (*no_idt));



r~

2003-08-17 01:34:31

by Linus Torvalds

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.


On Sat, 16 Aug 2003, Richard Henderson wrote:
>
> Fixed by doing
>
> __asm__ __volatile__("lidt %0": :"m" (*no_idt));

Good catch, although I'd prefer something like this instead (ie change
"no_idt" to be a real IDT descriptor, like the other ones).

It shouldn't matter all that much, since the only thing that really
matters is to load the IDT with bogus values, so just about anything
should do it.

Linus

--- 1.9/arch/i386/kernel/reboot.c Mon Aug 11 14:55:58 2003
+++ edited/arch/i386/kernel/reboot.c Sat Aug 16 18:33:05 2003
@@ -16,7 +16,6 @@
*/
void (*pm_power_off)(void);

-static long no_idt[2];
static int reboot_mode;
int reboot_thru_bios;

@@ -87,7 +86,9 @@
unsigned long long * base __attribute__ ((packed));
}
real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, real_mode_gdt_entries },
-real_mode_idt = { 0x3ff, 0 };
+real_mode_idt = { 0x3ff, 0 },
+no_idt = { 0, 0 };
+

/* This is 16-bit protected mode code to disable paging and the cache,
switch to real mode and jump to the BIOS reset code.

2003-08-17 02:04:15

by Randy.Dunlap

[permalink] [raw]
Subject: Re: 2.6-test2: gcc-3.3.1 warning.

>
> On Sat, 16 Aug 2003, Richard Henderson wrote:
>>
>> Fixed by doing
>>
>> __asm__ __volatile__("lidt %0": :"m" (*no_idt));
>
> Good catch, although I'd prefer something like this instead (ie change
> "no_idt" to be a real IDT descriptor, like the other ones).
>
> It shouldn't matter all that much, since the only thing that really matters
> is to load the IDT with bogus values, so just about anything should do it.

Yep, I have had some private email about this and had this patch
queued for this weekend. Same as yours, use the struct for it.

~Randy