This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26511] New: Using -O3, doesn't assign in a pointer to a global structure
- From: "wielemak at science dot uva dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2006 13:30:05 -0000
- Subject: [Bug c/26511] New: Using -O3, doesn't assign in a pointer to a global structure
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Trying to compile SWI-Prolog (www.swi-prolog.org) on Debian-Alpha the
following is not compiled correctly (function initPrologThreads())
info = &threads[1];
info->tid = pthread_self();
info->pl_tid = 1; // this assignment is simply not done
info->thread_data = &PL_local_data;
info->status = PL_THREAD_RUNNING;
PL_local_data.thread.info = info;
PL_local_data.thread.magic = PL_THREAD_MAGIC;
Swapping the last two lines just below the first is a `work around'.
Compiled with the commandline:
gcc -c -I. -I/home/wielemaker/src/pl/src -I/home/wielemaker/src/pl/src/rc -Wall
-O3 -fno-strict-aliasing -mieee pl-thread.c -o pl-thread.o
$ gcc -v
Using built-in specs.
Target: alphaev67-unknown-linux-gnu
Configured with: ../gcc-4.0.2/configure --prefix=/usr/local
Thread model: posix
gcc version 4.0.2
I'll attach pl-thread.i. If you need the full source, please download
version 5.6.6 tarball from www.swi-prolog.org. There have been some patches
since, but the bug reproduces on that version.
--
Summary: Using -O3, doesn't assign in a pointer to a global
structure
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wielemak at science dot uva dot nl
GCC build triplet: alphaev67-unknown-linux-gnu
GCC host triplet: alphaev67-unknown-linux-gnu
GCC target triplet: alphaev67-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26511
- Follow-Ups:
- [Bug c/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: pinskia at gcc dot gnu dot org
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: falk at debian dot org
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: falk at debian dot org
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: falk at debian dot org
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: wielemak at science dot uva dot nl
- [Bug target/26511] Using -O3, doesn't assign in a pointer to a global structure
- From: falk at debian dot org