public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
@ 2020-03-16  8:47 marxin at gcc dot gnu.org
  2020-03-16  8:47 ` [Bug c/94188] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-16  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94188
           Summary: [10 Regression] error: request for member ‘node’ in
                    something not a structure or union since
                    r10-7127-gcb99630f254aaec6
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Reduced from lvm2:

$ cat libdm.i
struct dm_tree_link {
  int list;
  int node;
} fn1() {
  0 ? ((struct dm_tree_link *)((char *)fn1 -
                               (char *)&((struct dm_tree_link *)0)->list))
          ->node
    : 0;
}

$ gcc-9 libdm.i -c
$ gcc libdm.i -c
libdm.i: In function ‘fn1’:
libdm.i:7:11: error: request for member ‘node’ in something not a structure or
union
    7 |           ->node
      |           ^~

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
@ 2020-03-16  8:47 ` marxin at gcc dot gnu.org
  2020-03-16  9:13 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-16  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-03-16
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
      Known to work|                            |9.3.0
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.0
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.0
           Priority|P3                          |P1

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
  2020-03-16  8:47 ` [Bug c/94188] " marxin at gcc dot gnu.org
@ 2020-03-16  9:13 ` rguenth at gcc dot gnu.org
  2020-03-16 10:22 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-16  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch.

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
  2020-03-16  8:47 ` [Bug c/94188] " marxin at gcc dot gnu.org
  2020-03-16  9:13 ` rguenth at gcc dot gnu.org
@ 2020-03-16 10:22 ` marxin at gcc dot gnu.org
  2020-03-16 15:16 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-16 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Just for the record, I also see it in acpica package:

$ cat cfg.i
enum act_name { ACT_HTTP_REQ_AUTH };
struct act_rule {
  int list;
  enum act_name action
} fn1() {
  fn2(((struct act_rule *)((void *)fn2 - (void *)&((struct act_rule
*)0)->list))
          ->action);
}

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-03-16 10:22 ` marxin at gcc dot gnu.org
@ 2020-03-16 15:16 ` rguenth at gcc dot gnu.org
  2020-03-16 15:33 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-16 15:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 48043
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48043&action=edit
patch in testing

This is what I have now, bootstrapped OK after the extra two hunks but I still
see ICEs during testing.  Still fixing build_fold_addr_expr_with_type looks
inevitable ... (other option would be to remove the optimization when the type
doesn't match, but I guess that will regress as well).

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-03-16 15:16 ` rguenth at gcc dot gnu.org
@ 2020-03-16 15:33 ` jakub at gcc dot gnu.org
  2020-03-18  8:15 ` cvs-commit at gcc dot gnu.org
  2020-03-18  8:15 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-16 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Created attachment 48043 [details]
> patch in testing
> 
> This is what I have now, bootstrapped OK after the extra two hunks but I
> still
> see ICEs during testing.  Still fixing build_fold_addr_expr_with_type looks
> inevitable ... (other option would be to remove the optimization when the
> type
> doesn't match, but I guess that will regress as well).

We can always do the match.pd change as optimization only, when the type
matches or it isn't too hard to handle it, and tweak the PTA to handle the
(pointer) (pointer - pointer_constant) case as lame pointer offsetting that
preserves points-to of the first operand.

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-03-16 15:33 ` jakub at gcc dot gnu.org
@ 2020-03-18  8:15 ` cvs-commit at gcc dot gnu.org
  2020-03-18  8:15 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-18  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:4e3d3e40726e1b68bf52fa205c68495124ea60b8

commit r10-7237-g4e3d3e40726e1b68bf52fa205c68495124ea60b8
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 18 09:13:17 2020 +0100

    middle-end/94188 fix fold of addr expression generation

    This adds a missing type conversion to build_fold_addr_expr and adjusts
    fallout - build_fold_addr_expr was used as a convenience to build an
    ADDR_EXPR but some callers do not expect the result to be simplified
    to something else.

    2020-03-18  Richard Biener  <rguenther@suse.de>

            PR middle-end/94188
            * fold-const.c (build_fold_addr_expr): Convert address to
            correct type.
            * asan.c (maybe_create_ssa_name): Strip useless type conversions.
            * gimple-fold.c (gimple_fold_stmt_to_constant_1): Use build1
            to build the ADDR_EXPR which we don't really want to simplify.
            * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise.
            * tree-ssa-loop-im.c (gather_mem_refs_stmt): Likewise.
            * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
            (simplify_builtin_call): Strip useless type conversions.
            * tree-ssa-strlen.c (new_strinfo): Likewise.

            * gcc.dg/pr94188.c: New testcase.

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

* [Bug c/94188] [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6
  2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-03-18  8:15 ` cvs-commit at gcc dot gnu.org
@ 2020-03-18  8:15 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-18  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-03-18  8:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16  8:47 [Bug c/94188] New: [10 Regression] error: request for member ‘node’ in something not a structure or union since r10-7127-gcb99630f254aaec6 marxin at gcc dot gnu.org
2020-03-16  8:47 ` [Bug c/94188] " marxin at gcc dot gnu.org
2020-03-16  9:13 ` rguenth at gcc dot gnu.org
2020-03-16 10:22 ` marxin at gcc dot gnu.org
2020-03-16 15:16 ` rguenth at gcc dot gnu.org
2020-03-16 15:33 ` jakub at gcc dot gnu.org
2020-03-18  8:15 ` cvs-commit at gcc dot gnu.org
2020-03-18  8:15 ` 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).