[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#195834: marked as done ([PR 11371] bogus warning and/or mis-optimization on ia64)



Your message dated Fri, 19 Sep 2003 21:17:40 -0700
with message-id <20030920041740.GA32188@cyberhqz.com>
and subject line documented defect
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 2 Jun 2003 17:44:26 +0000
>From james@ruari-quinn.demon.co.uk Mon Jun 02 12:44:25 2003
Return-path: <james@ruari-quinn.demon.co.uk>
Received: from cicero.e-mis.co.uk [212.240.194.162] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19MtIb-00044e-00; Mon, 02 Jun 2003 12:44:25 -0500
Received: from [10.139.58.254] (helo=tacitus)
	by cicero.e-mis.co.uk with esmtp (Exim 3.35 #1 (Debian))
	id 19MtIa-0001vS-00
	for <submit@bugs.debian.org>; Mon, 02 Jun 2003 18:40:44 +0100
Received: from james by tacitus with local (Exim 3.36 #1 (Debian))
	id 19MtIZ-0000rU-00
	for <submit@bugs.debian.org>; Mon, 02 Jun 2003 18:40:43 +0100
To: submit@bugs.debian.org
Subject: gcc: bogus warning and/or mis-optimization on ia64
Mail-Copies-To: never
From: James Troup <james@nocrew.org>
Date: Mon, 02 Jun 2003 18:40:43 +0100
Message-ID: <87wug4wf6s.fsf@nocrew.org>
User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/20.7 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: James Troup <james@ruari-quinn.demon.co.uk>
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-12.3 required=4.0
	tests=BAYES_01,HAS_PACKAGE,USER_AGENT_GNUS_UA
	autolearn=ham version=2.53-bugs.debian.org_2003_05_24
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_05_24 (1.174.2.15-2003-03-30-exp)

Package: gcc-3.3
Version: 3.3-2

| troup@merulo:~/gdbm-1.8.3$ gcc -O2 -Wall -c gdbmopen.c
| gdbmopen.c: In function `gdbm_open':
| gdbmopen.c:15: warning: `lock_val' might be used uninitialized in this function

|   fstat (dbf->desc, &file_stat);
|
|   if ((flags & GDBM_OPENMASK) == GDBM_READER)
|   {
|       if (dbf->file_locking)
|         {
|           struct flock flock;
|           flock.l_type = F_RDLCK;
|           flock.l_whence = SEEK_SET;
|           flock.l_start = flock.l_len = 0L;
|           lock_val = fcntl (dbf->desc, F_SETLK, &flock);
|         }
|     }
|   else if (dbf->file_locking)
|     {
|       struct flock flock;
|       flock.l_type = F_WRLCK;
|       flock.l_whence = SEEK_SET;
|       flock.l_start = flock.l_len = 0L;
|       lock_val = fcntl (dbf->desc, F_SETLK, &flock);
|     }
|   if (dbf->file_locking && (lock_val != 0))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|     {
|       return NULL;
|     }

I think this warning is bogus because a) it only happens on ia64
(AFAICT, it doesn't happen on arm, i386 or hppa, at least), b) it only
happens with optimization turned on (disappears with -O0) and
c) if the (entirely unrelated) fstat call is commented out, the
warning disappears.  I also think that it's clear from the code above
that lock_val couldn't be used uninitialized unless I'm missing
something embarrassingly obvious.  Unfortunately I haven't been able
to determine if it's just a bogus warning or if the code's actually
being mis-compiled.

This isn't a regression, all previous versions of gcc (2.96, 3.0 and
3.2) for ia64 have the same problem and gcc-snapshot (20030531-2)
doesn't fix it.

http://people.debian.org/~troup/gcc/gdbm/ contains gdbmopen.{c,i},
fixed-gdbmopen.{c,i} (i.e. with the fstat commented out) and
orig-gdbmopen.{c,i} (the unreduced original file from gdbm 1.8.3).

-- 
James

---------------------------------------
Received: (at 195834-done) by bugs.debian.org; 20 Sep 2003 04:17:43 +0000
>From rmurray@cyberhqz.com Fri Sep 19 23:17:41 2003
Return-path: <rmurray@cyberhqz.com>
Received: from h24-77-96-253.sbm.shawcable.net (straylight.cyberhqz.com) [24.77.96.253] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1A0ZBl-0006Vp-00; Fri, 19 Sep 2003 23:17:41 -0500
Received: from cyberhq.internal.cyberhqz.com (cyberhq.internal.cyberhqz.com [192.168.0.2])
	by straylight.cyberhqz.com (Postfix) with ESMTP id 123F354035
	for <195834-done@bugs.debian.org>; Fri, 19 Sep 2003 21:17:41 -0700 (PDT)
Received: by cyberhq.internal.cyberhqz.com (Postfix, from userid 1000)
	id C067D1B96F6; Fri, 19 Sep 2003 21:17:40 -0700 (PDT)
Date: Fri, 19 Sep 2003 21:17:40 -0700
To: 195834-done@bugs.debian.org
Subject: documented defect
Message-ID: <20030920041740.GA32188@cyberhqz.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.4i
From: rmurray@cyberhqz.com (Ryan Murray)
Delivered-To: 195834-done@bugs.debian.org
X-Spam-Status: No, hits=1.0 required=4.0
	tests=BAYES_60
	version=2.53-bugs.debian.org_2003_9_16
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_9_16 (1.174.2.15-2003-03-30-exp)

Upstream has closed this bug report with the following message:

------- Additional Comment #1 From Andrew Pinski  2003-06-29 13:47 -------
This is a know documented defect of gcc's warning about uninitialized
variables.  In fact gcc should warn about it on all platforms but it
does not.
Here is the sample from the documenation:
{
  int save_y;
  if (change_y) save_y = y, y = new_y;
  ...
  if (change_y) y = save_y;
} 

which is almost like your code but slightly different so this is not a bug.




Reply to: