Skip to contentSkip to conversation

2.6-test2: gcc-3.3.1 warning.

DISCUSSION Luiz Capitulino 9 participants 17 messages Jul 28, 2003 – Aug 17, 2003

lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
Luiz Fernando N. Capitulino

<[email protected]>
<http://www.telecentros.sp.gov.br>
#1 lore raw

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

#3 lore raw

Quoth Tomas Szepe:

Quoted 5 lines
Quoted 3 lines

[[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

Signature · 2 lines
"It's kind of fun to do the impossible."
		-- Walt Disney
#4 lore raw
Quoted 10 lines

[[email protected]]

Quoth Tomas Szepe:

Quoted 5 lines
Quoted 3 lines

[[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?

Signature · 1 line
Tomas Szepe <[email protected]>
#5 lore raw
Quoted 7 lines · Tomas Szepe
Quoted 7 lines

[[email protected]]

Quoth Tomas Szepe:

Quoted 4 lines
Quoted 3 lines

[[email protected]]

Subject: Re: 2.6-test2: gcc-3.3.1 warning.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

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.

Signature · 6 lines
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))
#6 lore raw
Quoted 3 lines · Tomas Szepe

Then why are we all calling current kernel 2.4.22 instead of 2.4.21.90 ?

WE aren't.

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

Quoted 1 line

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.

Signature · 1 line
Tomas Szepe <[email protected]>
#7 lore raw
Quoted 3 lines · Tomas Szepe
Quoted 3 lines · Tomas Szepe

Then why are we all calling current kernel 2.4.22 instead of

2.4.21.90 ?

Quoted 6 lines

WE aren't.

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.

Quoted 5 lines

The latest snapshot for the stable Linux kernel tree is: 2.4.21-bk20

Quoted 1 line

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.

Quoted 1 line

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.

Signature · 6 lines
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))
#8 lore raw
Quoted 5 lines

[[email protected]]

Quoted 1 line

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?

Quoted 2 lines

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?"

Quoted 1 line

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?

Quoted 3 lines

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.

Quoted 1 line

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

Right.

Signature · 1 line
Tomas Szepe <[email protected]>
#9 lore raw

On 07.29, Tomas Szepe wrote:
[...]

Quoted 2 lines

Does Mandrake also ship "stable" distributions w/ kernels compiled

using

Quoted 2 lines

gcc 3.3-whatever or is that idiocy suse-specific?

Tell me a distro that ships pristine 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 ?

Signature · 6 lines
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))
#10 lore raw
Quoted 7 lines

[[email protected]]

Quoted 2 lines

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 www.kernel.org kernels o release gcc's, without any 'backported patch from xxx-1234 to correct PR1234'.

Slackware (whenever possible).

Quoted 2 lines

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
Quoted 2 lines

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.

Signature · 1 line
Tomas Szepe <[email protected]>
#11 lore raw
Quoted 7 lines · Tomas Szepe
Quoted 2 lines

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/

#12 lore raw

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

#13 lore raw
Quoted 7 lines · Randy.Dunlap

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~

#14 lore raw
Quoted 4 lines · Richard Henderson

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

arch/i386/kernel/reboot.c +3 -2
@@ -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.
#15 lore raw
Quoted 12 lines · Richard Henderson
Quoted 4 lines

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

#16 lore raw
In reply to Tomas Szepe
Quoted 4 lines · Tomas Szepe
Quoted 2 lines

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