public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
@ 2003-12-13 15:33 carlo at gcc dot gnu dot org
  2003-12-15  9:27 ` [Bug c/13394] " bangerth at dealii dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: carlo at gcc dot gnu dot org @ 2003-12-13 15:33 UTC (permalink / raw)
  To: gcc-bugs

A real-life program gave me an erroneous warning
'`noreturn' function does return', while it is
impossible that it returns and more importantly:
it indeed doesn't return: it is a logical error
to ignore a recursively invokated functions
noreturn attribute when determining the validness
of that noreturn attribute.

Now, a possible warning would be: '`noreturn' function
might caught stack overflow due to self-invokation',
but the keyword there is MIGHT. And I think that
the explicit existance of the `noreturn' attribute
should give us the favour of gcc's doubt: this function
will exit somehow.  It CERTAINLY doesn't return.

Example snippet:

int f(void) __attribute__ ((__noreturn__));
void _exit(int status) __attribute__ ((__noreturn__));

int z = 0;

int f()
{
  if (++z > 10)
    _exit(0);
  f();
}


>gcc-cvs-3.4 -Wall -O2 -c noreturn.c
noreturn.cc: In function `int f()':
noreturn.cc:11: warning: `noreturn' function does return

This is a regression: gcc 3.2.3 and all previous versions
of gcc (tried 2.95.3, 2.96, 3.0.4, 3.1.1 and 3.2.x) do not
give the warning.

-- 
           Summary: [3.3/3.4 Regression] noreturn attribute ignored on
                    recursive invokation
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carlo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
@ 2003-12-15  9:27 ` bangerth at dealii dot org
  2003-12-15 17:28 ` carlo at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-12-15  9:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-12-15 09:27 -------
Confirmed. 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
  2003-12-15  9:27 ` [Bug c/13394] " bangerth at dealii dot org
@ 2003-12-15 17:28 ` carlo at gcc dot gnu dot org
  2003-12-16 16:35 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: carlo at gcc dot gnu dot org @ 2003-12-15 17:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From carlo at gcc dot gnu dot org  2003-12-15 17:28 -------
Was confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-15 17:28:33
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
  2003-12-15  9:27 ` [Bug c/13394] " bangerth at dealii dot org
  2003-12-15 17:28 ` carlo at gcc dot gnu dot org
@ 2003-12-16 16:35 ` pinskia at gcc dot gnu dot org
  2003-12-20 11:21 ` [Bug optimization/13394] " ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-16 16:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-16 16:27 -------
>From Phil's regression hunter: Search converges between 2003-03-09-trunk (#240) and 2003-03
-10-trunk (#241).
: Search converges between 2003-03-12-3.3 (#77) and 2003-03-13-3.3 (#78).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug optimization/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-12-16 16:35 ` pinskia at gcc dot gnu dot org
@ 2003-12-20 11:21 ` ebotcazou at gcc dot gnu dot org
  2003-12-20 11:23 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2003-12-20 11:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2003-12-20 10:56 -------
Fixing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug optimization/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-12-20 11:21 ` [Bug optimization/13394] " ebotcazou at gcc dot gnu dot org
@ 2003-12-20 11:23 ` ebotcazou at gcc dot gnu dot org
  2003-12-23  5:54 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2003-12-20 11:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug optimization/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-12-20 11:23 ` ebotcazou at gcc dot gnu dot org
@ 2003-12-23  5:54 ` cvs-commit at gcc dot gnu dot org
  2003-12-23  8:42 ` cvs-commit at gcc dot gnu dot org
  2003-12-23  8:47 ` ebotcazou at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-23  5:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-23 05:32 -------
Subject: Bug 13394

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2003-12-23 05:32:02

Modified files:
	gcc            : ChangeLog toplev.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: noreturn-7.c 

Log message:
	PR optimization/13394
	* toplev.c (rest_of_compilation): Move call to
	check_function_return_warnings right after the sibcall
	optimization pass.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2081&r2=2.2082
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.852&r2=1.853
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3303&r2=1.3304
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noreturn-7.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug optimization/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2003-12-23  5:54 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-23  8:42 ` cvs-commit at gcc dot gnu dot org
  2003-12-23  8:47 ` ebotcazou at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-23  8:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-23 06:28 -------
Subject: Bug 13394

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2003-12-23 06:28:37

Modified files:
	gcc            : ChangeLog toplev.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: noreturn-7.c 

Log message:
	PR optimization/13394
	* toplev.c (rest_of_compilation): Move call to
	check_function_return_warnings right after the sibcall
	optimization pass.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.856&r2=1.16114.2.857
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.690.2.23&r2=1.690.2.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.344&r2=1.2261.2.345
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noreturn-7.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug optimization/13394] [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation
  2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2003-12-23  8:42 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-23  8:47 ` ebotcazou at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2003-12-23  8:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2003-12-23 06:29 -------
See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01868.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13394


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-12-23  6:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-13 15:33 [Bug c/13394] New: [3.3/3.4 Regression] noreturn attribute ignored on recursive invokation carlo at gcc dot gnu dot org
2003-12-15  9:27 ` [Bug c/13394] " bangerth at dealii dot org
2003-12-15 17:28 ` carlo at gcc dot gnu dot org
2003-12-16 16:35 ` pinskia at gcc dot gnu dot org
2003-12-20 11:21 ` [Bug optimization/13394] " ebotcazou at gcc dot gnu dot org
2003-12-20 11:23 ` ebotcazou at gcc dot gnu dot org
2003-12-23  5:54 ` cvs-commit at gcc dot gnu dot org
2003-12-23  8:42 ` cvs-commit at gcc dot gnu dot org
2003-12-23  8:47 ` ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).