public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gary at intrepid dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/27445] create_tmp_var_raw (gimplify.c) inadventently asserts 'volatile' on temps Date: Fri, 05 May 2006 17:55:00 -0000 [thread overview] Message-ID: <20060505175510.18153.qmail@sourceware.org> (raw) In-Reply-To: <bug-27445-9975@http.gcc.gnu.org/bugzilla/> ------- Comment #9 from gary at intrepid dot com 2006-05-05 17:55 ------- > Your issue with ++j not using incr is not related to the gimplifier at all as > it also happens in every compiler version since at least 2.95.3. I agree that is unrelated. I didn't file this bug thinking that it would help "fix" the "incr issue". In fact, I don't really have an "incr issue" -- it was just something that came up while I was writing some tests. > > Gimplify in its present form might transform the statement above into > > something like the following: [...] > It will never get the wrong type. because create_tmp_from_val uses > TYPE_MAIN_VARIANT. Well, I originally noticed the problem in 4.0.1, which has the following code: static inline tree create_tmp_from_val (tree val) { return create_tmp_var (TREE_TYPE (val), get_name (val)); } The dev tree now how this code: static inline tree create_tmp_from_val (tree val) { return create_tmp_var (TYPE_MAIN_VARIANT (TREE_TYPE (val)), get_name (val)); } I haven't looked into the rev. history, to see why/when this fix was made, but will ask the hypothetical: was this fix made to workaround the misbehavior in create_tmp_var_raw()? Note that create_tmp_var_raw() is exported from gimplify.c and appears to be called from quite a few places. The question arises: what are the preconditions for calling create_tmp_var_raw()? If you want to assert that it uses whatever type was passed in and all the callers have to remove qualifiers as necessary that's fine, but requires some knowledge of the original intent behind create_tmp_var_raw() and the assumptions its callers make. I'd be temtpted to add an assert that the type passed in has no qualifiers if that is a pre-condition. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27445
next prev parent reply other threads:[~2006-05-05 17:55 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-05-05 16:02 [Bug c/27445] New: " gary at intrepid dot com 2006-05-05 16:05 ` [Bug c/27445] " pinskia at gcc dot gnu dot org 2006-05-05 16:06 ` gary at intrepid dot com 2006-05-05 16:12 ` gary at intrepid dot com 2006-05-05 16:16 ` [Bug middle-end/27445] " pinskia at gcc dot gnu dot org 2006-05-05 16:37 ` gary at intrepid dot com 2006-05-05 16:39 ` Andrew Pinski 2006-05-05 16:39 ` pinskia at physics dot uc dot edu 2006-05-05 16:58 ` gary at intrepid dot com 2006-05-05 17:10 ` pinskia at gcc dot gnu dot org 2006-05-05 17:55 ` gary at intrepid dot com [this message] 2006-05-05 18:06 ` Daniel Berlin 2006-05-05 18:07 ` dberlin at dberlin dot org 2006-05-06 1:17 ` rth at gcc dot gnu dot org 2006-05-06 1:42 ` gary at intrepid dot com
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=20060505175510.18153.qmail@sourceware.org \ --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: linkBe 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).