public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR
@ 2013-11-15 18:45 glisse at gcc dot gnu.org
  2013-11-18 12:50 ` [Bug tree-optimization/59149] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-15 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59149
           Summary: diagnose_tm_1 calls flags_from_decl_or_type on an
                    ADDR_EXPR
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

(I haven't seen a category for transactional memory)
In trans-mem.c, function diagnose_tm_1 has:

if (flags_from_decl_or_type (fn) & ECF_TM_BUILTIN)

earlier, it tries:

            if (TREE_CODE (fn) == ADDR_EXPR
                && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL)
              {
                direct_call_p = true;
                replacement = TREE_OPERAND (fn, 0);
                replacement = find_tm_replacement_function (replacement);
                if (replacement)
                  fn = replacement;
              }

which in many cases leaves the ADDR_EXPR in fn.

I believe flags_from_decl_or_type shouldn't be called with anything other than
a decl or a type and we could add an assertion in there. If you disagree, feel
free to close the PR. I noticed this because it broke a local patch of mine
where I added code to flags_from_decl_or_type that didn't like ADDR_EXPR.


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

* [Bug tree-optimization/59149] diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR
  2013-11-15 18:45 [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR glisse at gcc dot gnu.org
@ 2013-11-18 12:50 ` rguenth at gcc dot gnu.org
  2013-12-12 23:10 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-18 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Agreed - the code should have a gcc_unreachable () else.


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

* [Bug tree-optimization/59149] diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR
  2013-11-15 18:45 [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR glisse at gcc dot gnu.org
  2013-11-18 12:50 ` [Bug tree-optimization/59149] " rguenth at gcc dot gnu.org
@ 2013-12-12 23:10 ` aldyh at gcc dot gnu.org
  2013-12-13 17:50 ` aldyh at gcc dot gnu.org
  2013-12-13 17:51 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-12-12 23:10 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-12-12
                 CC|                            |aldyh at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Mine.

Proposed patch:

http://gcc.gnu.org/ml/gcc-patches/2013-12/msg01209.html


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

* [Bug tree-optimization/59149] diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR
  2013-11-15 18:45 [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR glisse at gcc dot gnu.org
  2013-11-18 12:50 ` [Bug tree-optimization/59149] " rguenth at gcc dot gnu.org
  2013-12-12 23:10 ` aldyh at gcc dot gnu.org
@ 2013-12-13 17:50 ` aldyh at gcc dot gnu.org
  2013-12-13 17:51 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-12-13 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Author: aldyh
Date: Fri Dec 13 17:50:18 2013
New Revision: 205967

URL: http://gcc.gnu.org/viewcvs?rev=205967&root=gcc&view=rev
Log:
    PR tree-optimization/59149
    * calls.c (flags_from_decl_or_type): Fail on non decl or type.
    * trans-mem.c (diagnose_tm_1): Do not call flags_from_decl_or_type
    if no type or decl.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/calls.c
    trunk/gcc/trans-mem.c


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

* [Bug tree-optimization/59149] diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR
  2013-11-15 18:45 [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-12-13 17:50 ` aldyh at gcc dot gnu.org
@ 2013-12-13 17:51 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2013-12-13 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fix committed


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

end of thread, other threads:[~2013-12-13 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-15 18:45 [Bug tree-optimization/59149] New: diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR glisse at gcc dot gnu.org
2013-11-18 12:50 ` [Bug tree-optimization/59149] " rguenth at gcc dot gnu.org
2013-12-12 23:10 ` aldyh at gcc dot gnu.org
2013-12-13 17:50 ` aldyh at gcc dot gnu.org
2013-12-13 17:51 ` aldyh 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).