public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/48116] New: -Wreturn-type does not work as advertised
@ 2011-03-14 17:08 tromey at gcc dot gnu.org
  2011-03-14 17:18 ` [Bug c/48116] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tromey at gcc dot gnu.org @ 2011-03-14 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: -Wreturn-type does not work as advertised
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tromey@gcc.gnu.org


I'm using svn trunk gcc as of today.

-Wreturn-type is documented as:

  [... warn] about a `return' statement with a expression
  in a function whose return-type is `void'.

I tried it with this test case:

void x (void) { }
void y(void) { return x(); }

I expected a warning on the `return', but did not get one:

I used "gcc -Wreturn-type -O2 -c q.c"


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
@ 2011-03-14 17:18 ` pinskia at gcc dot gnu.org
  2011-03-14 17:21 ` tromey at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-03-14 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-14 17:18:20 UTC ---
apinski@apinskidesktop:~$ gcc t.c -W -Wall -pedantic -S
t.c: In function ‘y’:
t.c:2: warning: ISO C forbids ‘return’ with expression, in function returning
void


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
  2011-03-14 17:18 ` [Bug c/48116] " pinskia at gcc dot gnu.org
@ 2011-03-14 17:21 ` tromey at gcc dot gnu.org
  2014-09-24 18:03 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu.org @ 2011-03-14 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tom Tromey <tromey at gcc dot gnu.org> 2011-03-14 17:20:47 UTC ---
Thanks, but I think it is still a bug as-is.
I don't see why -pedantic should be required here.


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
  2011-03-14 17:18 ` [Bug c/48116] " pinskia at gcc dot gnu.org
  2011-03-14 17:21 ` tromey at gcc dot gnu.org
@ 2014-09-24 18:03 ` mpolacek at gcc dot gnu.org
  2014-10-18 10:55 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-09-24 18:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-09-24
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine.


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-09-24 18:03 ` mpolacek at gcc dot gnu.org
@ 2014-10-18 10:55 ` mpolacek at gcc dot gnu.org
  2015-04-22 12:00 ` jakub at gcc dot gnu.org
  2015-07-16  9:12 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-10-18 10:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|mpolacek at gcc dot gnu.org        |unassigned at gcc dot gnu.org

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #4)
> Do you have even an unfinished patch? I will add this to the list of
> EasyHacks.

I have nothing so far, I couldn't get to this one yet.  I'm going to unassign
myself for now, maybe I'll get to this one some day.

Feel free to put it on EasyHacks.
>From gcc-bugs-return-464414-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 18 11:10:44 2014
Return-Path: <gcc-bugs-return-464414-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5144 invoked by alias); 18 Oct 2014 11:10:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5118 invoked by uid 48); 18 Oct 2014 11:10:40 -0000
From: "maxim.prohorenko at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55698] gcc does not report warning if operator not used : control reaches end of non-void function [-Wreturn-type]
Date: Sat, 18 Oct 2014 11:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: maxim.prohorenko at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-55698-4-IeTNUhuj0l@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55698-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55698-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-10/txt/msg01435.txt.bz2
Content-length: 229

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55698

--- Comment #3 from Максим Прохоренко <maxim.prohorenko at gmail dot com> ---
Thanks guys.
>From gcc-bugs-return-464415-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 18 11:21:48 2014
Return-Path: <gcc-bugs-return-464415-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8303 invoked by alias); 18 Oct 2014 11:21:48 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8275 invoked by uid 48); 18 Oct 2014 11:21:45 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63586] New: x+x+x+x -> 4*x in gimple
Date: Sat, 18 Oct 2014 11:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-63586-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-10/txt/msg01436.txt.bz2
Content-length: 875

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc586

            Bug ID: 63586
           Summary: x+x+x+x -> 4*x in gimple
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

unsigned f(unsigned x){
  unsigned y = x + x;
  y = y + x;
  y = y + x;
  y = y + x;
  y = y + x;
  y = y + x;
  y = y + x;
  return y;
}

The .optimized dump still shows:

  y_2 = x_1(D) + x_1(D);
  y_3 = y_2 + x_1(D);
  y_4 = y_3 + x_1(D);
  y_5 = y_4 + x_1(D);
  y_6 = y_5 + x_1(D);
  y_7 = y_6 + x_1(D);
  y_8 = y_7 + x_1(D);
  return y_8;

RTL later optimizes it to x<<3 (leal), but I am surprised we aren't doing
anything in gimple. I would expect us to canonicalize to 8*x.


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-10-18 10:55 ` mpolacek at gcc dot gnu.org
@ 2015-04-22 12:00 ` jakub at gcc dot gnu.org
  2015-07-16  9:12 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 12:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.0                         |5.2

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.


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

* [Bug c/48116] -Wreturn-type does not work as advertised
  2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-04-22 12:00 ` jakub at gcc dot gnu.org
@ 2015-07-16  9:12 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16  9:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48116

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.2                         |5.3

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.


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

end of thread, other threads:[~2015-07-16  9:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14 17:08 [Bug c/48116] New: -Wreturn-type does not work as advertised tromey at gcc dot gnu.org
2011-03-14 17:18 ` [Bug c/48116] " pinskia at gcc dot gnu.org
2011-03-14 17:21 ` tromey at gcc dot gnu.org
2014-09-24 18:03 ` mpolacek at gcc dot gnu.org
2014-10-18 10:55 ` mpolacek at gcc dot gnu.org
2015-04-22 12:00 ` jakub at gcc dot gnu.org
2015-07-16  9:12 ` rguenth at gcc dot gnu.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).