public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47347] New: "pragma GCC diagnostic ignored" has no effect sometimes
@ 2011-01-18 17:31 gcc at dpinol dot com
  2011-01-18 18:14 ` [Bug c++/47347] " redi at gcc dot gnu.org
  2013-11-16 20:06 ` [Bug c++/47347] "pragma GCC diagnostic ignored" has no effect for templates manu at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gcc at dpinol dot com @ 2011-01-18 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: "pragma GCC diagnostic ignored" has no effect
                    sometimes
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gcc@dpinol.com


The code below produces warning "warning: unused parameter ‘a’
[-Wunused-parameter]" were it shouldn't, since this diagnostic should be
ignored.
If we remove the final line, the warning does not appear, but I understand that
a pragma should not affect previous lines.

#pragma GCC diagnostic ignored "-Wunused-parameter"

#include <vector>

template <class ContainerAllocator>
struct KeyValue
{
public:
  virtual ~KeyValue()
  {
  }

  virtual void serialize(int a) const
  {
  }
};

void f()
{
  std::vector< KeyValue<int >  >  values;
}
#pragma GCC diagnostic warning "-Wunused-parameter"


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

* [Bug c++/47347] "pragma GCC diagnostic ignored" has no effect sometimes
  2011-01-18 17:31 [Bug c++/47347] New: "pragma GCC diagnostic ignored" has no effect sometimes gcc at dpinol dot com
@ 2011-01-18 18:14 ` redi at gcc dot gnu.org
  2013-11-16 20:06 ` [Bug c++/47347] "pragma GCC diagnostic ignored" has no effect for templates manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-18 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-18 17:32:39 UTC ---
reduced:

#pragma GCC diagnostic ignored "-Wunused-parameter"

template <class>
struct KeyValue
{
  virtual void serialize(int a) const
  {
  }
};

void f()
{
  KeyValue<int>  values;
}
#pragma GCC diagnostic warning "-Wunused-parameter"


The template instantiation is at the end of the file, after the warning has
been re-enabled.

There's no warning with 4.6.0


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

* [Bug c++/47347] "pragma GCC diagnostic ignored" has no effect for templates
  2011-01-18 17:31 [Bug c++/47347] New: "pragma GCC diagnostic ignored" has no effect sometimes gcc at dpinol dot com
  2011-01-18 18:14 ` [Bug c++/47347] " redi at gcc dot gnu.org
@ 2013-11-16 20:06 ` manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2013-11-16 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |manu at gcc dot gnu.org
      Known to work|                            |4.6.0
         Resolution|---                         |FIXED
            Summary|"pragma GCC diagnostic      |"pragma GCC diagnostic
                   |ignored" has no effect      |ignored" has no effect for
                   |sometimes                   |templates

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
It works for me in GCC 4.9.

I think this was fixed when we introduce the push/pop pragmas. Now we store the
ranges forever, so it doesn't matter when the warning is given, only that the
location of the warning is the correct one.
>From gcc-bugs-return-434766-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Nov 16 20:10:09 2013
Return-Path: <gcc-bugs-return-434766-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21292 invoked by alias); 16 Nov 2013 20:10:09 -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 21265 invoked by uid 48); 16 Nov 2013 20:10:05 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/59155] New: ICE: in reg_overlap_mentioned_p, at rtlanal.c:1473
Date: Sat, 16 Nov 2013 20:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: inline-asm
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
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 cf_gcctarget
Message-ID: <bug-59155-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: 2013-11/txt/msg01543.txt.bz2
Content-length: 1234

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY155

            Bug ID: 59155
           Summary: ICE: in reg_overlap_mentioned_p, at rtlanal.c:1473
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
            Target: x86_64-unknown-linux-gnu

double f(double x){
  asm volatile("":"+X"(x));
  return x;
}
double g(double x,double y){
  return f(f(x)+f(y));
}

compiled with -O2:

a.c: In function 'g':
a.c:7:1: internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1473
 }
 ^
0x967015 reg_overlap_mentioned_p(rtx_def const*, rtx_def const*)
    /data/repos/gcc/pristine/gcc/rtlanal.c:1473
0x7cde02 match_asm_constraints_1
    /data/repos/gcc/pristine/gcc/function.c:7164
0x7cdfda rest_of_match_asm_constraints
    /data/repos/gcc/pristine/gcc/function.c:7207
0x7cdfda execute
    /data/repos/gcc/pristine/gcc/function.c:7239
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

end of thread, other threads:[~2013-11-16 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 17:31 [Bug c++/47347] New: "pragma GCC diagnostic ignored" has no effect sometimes gcc at dpinol dot com
2011-01-18 18:14 ` [Bug c++/47347] " redi at gcc dot gnu.org
2013-11-16 20:06 ` [Bug c++/47347] "pragma GCC diagnostic ignored" has no effect for templates manu 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).