mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Dave Jones <davej@redhat.com>
Cc: Jesper Juhl <jesper.juhl@gmail.com>, Adrian Bunk <bunk@stusta.de>,
	Andrew Morton <akpm@osdl.org>,
	torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] offer CC_OPTIMIZE_FOR_SIZE only if EXPERIMENTAL
Date: Thu, 15 Dec 2005 16:01:44 +0100	[thread overview]
Message-ID: <m3bqzijtev.fsf@defiant.localdomain> (raw)
In-Reply-To: <20051215004006.GA19354@redhat.com> (Dave Jones's message of "Wed, 14 Dec 2005 19:40:06 -0500")

Dave Jones <davej@redhat.com> writes:

> Fedora has had this enabled most of the time for x86, x86-64, ia64,
> s390, s390x, ppc32 and ppc64 for a long time.  From time to time
> when a gcc bug has been tickled it's been disabled again until its
> been worked out, but for the most part, it's been a complete non-event
> wrt regressions.

BTW: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=173764

gcc generates incorrect code with -Os (i386).

Version-Release number of selected component (if applicable):
gcc-4.0.1-4.fc4 and gcc-4.0.2-8.fc4 (i.e., FC4-current)

gcc -W -Wall -Os test.c -o test -Werror && ./test
array: 1 2
array: 1 2

gcc -W -Wall -O2 test.c -o test -Werror && ./test
array: 1 2
array: 2 3

Additional info:
Marked "high" as it miscompiles the Linux kernel.

#include <stdio.h>

void test_it(int *array)
{
	int i;

	for (i = 0; i < 2; i++) {
		int value = array[i];
		if (i != 1000 && i != 1001)
			array[i] = value + 1;
	}
}

int main(void)
{
	int array[2] = {1, 2};

	printf("array: %i %i\n", array[0], array[1]);

	test_it(array);

	printf("array: %i %i\n", array[0], array[1]);

	return 0;
}

-- 
Krzysztof Halasa

  parent reply	other threads:[~2005-12-15 15:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 19:10 [2.6 patch] fix the EMBEDDED menu Adrian Bunk
2005-12-14 22:05 ` Andrew Morton
2005-12-14 22:13   ` [2.6 patch] offer CC_OPTIMIZE_FOR_SIZE only if EXPERIMENTAL Adrian Bunk
2005-12-14 22:18     ` Jesper Juhl
2005-12-14 22:28       ` Jesper Juhl
2005-12-15  0:40         ` Dave Jones
2005-12-15  5:24           ` David S. Miller
2005-12-15 15:01           ` Krzysztof Halasa [this message]
2005-12-15 17:35             ` Dave Jones
     [not found]             ` <7c3341450601191017o796faf45r2cc5c8e544dcfe11@mail.gmail.com>
2006-01-19 19:13               ` Dave Jones
2005-12-15 19:20         ` Denis Vlasenko
2005-12-14 22:22     ` Andrew Morton
2005-12-14 22:26       ` Adrian Bunk
2005-12-14 22:30       ` Russell King
2005-12-14 22:36     ` Linus Torvalds
2005-12-14 22:44       ` Adrian Bunk
2005-12-14 22:46         ` Adrian Bunk
2005-12-14 23:32         ` Linus Torvalds
2005-12-14 23:43           ` Adrian Bunk
2005-12-15  6:45           ` David S. Miller
2005-12-14 23:48       ` David S. Miller
2006-01-19 17:59       ` Eric Lammerts
2005-12-14 22:17   ` [2.6 patch] fix the EMBEDDED menu Russell King
2005-12-14 22:24     ` Adrian Bunk
2005-12-17 21:20     ` Nicolas Pitre
2005-12-15 13:01   ` Rogério Brito

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=m3bqzijtev.fsf@defiant.localdomain \
    --to=khc@pm.waw.pl \
    --cc=akpm@osdl.org \
    --cc=bunk@stusta.de \
    --cc=davej@redhat.com \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®