From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12709 invoked by alias); 14 Apr 2005 16:17:56 -0000 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 Received: (qmail 12268 invoked by uid 48); 14 Apr 2005 16:17:41 -0000 Date: Thu, 14 Apr 2005 16:17:00 -0000 From: "hermantenbrugge at home dot nl" To: gcc-bugs@gcc.gnu.org Message-ID: <20050414161730.21023.hermantenbrugge@home.nl> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libmudflap/21023] New: mudflap reports errors X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg01927.txt.bz2 List-Id: Yesterday I upgraded my fedora core 3 instalation and got gcc4 installed. I tested the mudflap code and found a problem. The reduced test case is below. when I have two programs a.c and b.c -- a.c -- typedef struct { char *name; } dummy; dummy d[] = { {"a"}, {0} }; -- b.c -- typedef struct { char *name; } dummy; extern dummy d[]; int main (void) { dummy *pd = d; while (pd->name) { printf ("%s\n", pd->name); pd++; } } and compile this with: gcc4 -fmudflap a.c b.c -o a -lmudflap when I run the program I get: a ******* mudflap violation 1 (check/read): time=1113495140.046642 ptr=0x8049a00 size=4 pc=0xb7eff322 location=`b.c:9 (main)' /usr/lib/libmudflap.so.0(__mf_check+0x44) [0xb7eff322] ./a(main+0x8b) [0x8048787] /usr/lib/libmudflap.so.0(__wrap_main+0x1d8) [0xb7f0004e] Nearby object 1: checked region begins 8B before and ends 5B before mudflap object 0x80ca090: name=`__mf_lc_mask' bounds=[0x8049a08,0x8049a0b] size=4 area=no-access check=0r/0w liveness=0 alloc time=1113495140.046375 pc=0xb7effe0a Nearby object 2: checked region begins 16B before and ends 13B before mudflap object 0x80ca028: name=`__mf_lookup_cache' bounds=[0x8049a10,0x80c9a0f] size=524288 area=no-access check=0r/0w liveness=0 alloc time=1113495140.046371 pc=0xb7effe0a number of nearby objects: 2 There should be no error. I think the problem is in tree-mudflap.c in function mudflap_finish_file. Here is a check for TREE_STATIC. I think this should be !TREE_PUBLIC ??? I assigned this to 4.0.1 because I probably can not assign this to 4.0.0 anymore? -- Summary: mudflap reports errors Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libmudflap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hermantenbrugge at home dot nl CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21023