public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/106764] [12/13 Regression] ICE on invalid code in tree check: expected function_type or method_type, have error_mark in gimplify_call_expr, at gimplify.cc
Date: Thu, 17 Nov 2022 20:06:05 +0000	[thread overview]
Message-ID: <bug-106764-4-BM73PO6NRC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106764-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
At the point where the CALL_EXPR is built:
Breakpoint 5, build_function_call_vec (loc=258624, arg_loc=...,
function=<var_decl 0x7ffff7251cf0 a>, params=0x0, origtypes=0x0,
orig_fundecl=<tree 0x0>) at
/home/apinski/src/upstream-gcc/gcc/gcc/c/c-typeck.cc:3250
3250      fntype = TREE_TYPE (function);

function is:
(gdb) p debug_tree(function)
 <var_decl 0x7ffff7251cf0 a
    type <pointer_type 0x7ffff73e5930
        type <function_type 0x7ffff726e9d8 type <integer_type 0x7ffff72615e8
int>
            QI
            size <integer_cst 0x7ffff7242e88 constant 8>
            unit-size <integer_cst 0x7ffff7242ea0 constant 1>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff726e9d8
            pointer_to_this <pointer_type 0x7ffff73e5930>>
        unsigned DI
        size <integer_cst 0x7ffff7242d98 constant 64>
        unit-size <integer_cst 0x7ffff7242db0 constant 8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff73e5930>
    used public static unsigned read DI defer-output t.c:1:3 size <integer_cst
0x7ffff7242d98 64> unit-size <integer_cst 0x7ffff7242db0 8>
    align:64 warn_if_not_align:0>

And the type is fine.
And then the code in duplicate_decls goes and replaces the type to be
error_mark_node.
And then we don't check for error_mark_node later on during gimplification.

Trying to figure out the best place to put the check for error_mark_node now.


Note while looking into the gimplification code, I found some odd looking code
dealing with the location so I filed PR 107737.

  parent reply	other threads:[~2022-11-17 20:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28 15:10 [Bug c/106764] New: " k.even-mendoza at imperial dot ac.uk
2022-08-28 15:51 ` [Bug c/106764] " pinskia at gcc dot gnu.org
2022-08-29  8:36 ` rguenth at gcc dot gnu.org
2022-08-29 13:41 ` marxin at gcc dot gnu.org
2022-10-22  0:13 ` [Bug c/106764] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-11-15 19:37 ` pinskia at gcc dot gnu.org
2022-11-17 20:06 ` pinskia at gcc dot gnu.org [this message]
2022-11-17 20:21 ` pinskia at gcc dot gnu.org
2022-11-18 17:03 ` cvs-commit at gcc dot gnu.org
2022-11-18 17:05 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106764-4-BM73PO6NRC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).