From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19912 invoked by alias); 24 Sep 2006 05:34:12 -0000 Received: (qmail 19878 invoked by uid 48); 24 Sep 2006 05:34:04 -0000 Date: Sun, 24 Sep 2006 05:34:00 -0000 Message-ID: <20060924053404.19877.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/29198] [4.0/4.1/4.2 Regression] Incorrect reference to __thread array with -fPIC -O2 on x86 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg02278.txt.bz2 List-Id: ------- Comment #3 from pinskia at gcc dot gnu dot org 2006-09-24 05:34 ------- Here is a testcase which shows this is a latent bug: extern int f2 (int, int, int, int); struct s { char b[4]; }; __thread struct s a[2]; void f1 (int a1, int a2) { int i, j; for (i = 0; i < 4; i++) { int tot = 0; for (j = 0; j < 4; j++) tot += f2 (a1, a2, i, j); *(&a[0].b[0] + i) = tot; } } ------ But since the orginal testcase worked in 3.4.0, this should be still marked as a regression, IV-OPTs is causing the latent bug to show up. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29198