public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/96540] New: gcc fails to build on Darwin 19.6.0
@ 2020-08-09 10:59 juergen.reuter at desy dot de
  2020-08-10  7:14 ` [Bug c/96540] " juergen.reuter at desy dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-09 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96540
           Summary: gcc fails to build on Darwin 19.6.0
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

I am using the following setup:
Darwin 19.6.0, macOS Catalina 10.15.6, XCode v11.6, with clang
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

g++ -std=c++11  -fno-PIE -c  -DIN_GCC_FRONTEND -g  -DIN_GCC   
-fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag
-Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-I. -Ic -I../../gcc -I../../gcc/c -I../../gcc/../include -I./../intl
-I../../gcc/../libcpp/include -I/usr/local//include -I/usr/local//include 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/../libbacktrace -I/usr/local//include  -o c/gimple-parser.o -MT
c/gimple-parser.o -MMD -MP -MF c/.deps/gimple-parser.TPo
../../gcc/c/gimple-parser.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is
deprecated [-Wdeprecated]
warning: unknown warning option '-Werror=format-diag'
[-Wunknown-warning-option]
In file included from ../../gcc/c/gimple-parser.c:22:
In file included from ../../gcc/coretypes.h:476:
In file included from ../../gcc/hash-table.h:248:
../../gcc/vec.h:543:13: warning: 'constexpr' non-static member function will
not be implicitly 'const' in C++14; add
      'const' to avoid a change in behavior [-Wconstexpr-not-const]
  CONSTEXPR operator vec<T, A, L> () { return vec<T, A, L>(); }
            ^
                                     const
In file included from ../../gcc/c/gimple-parser.c:28:
../../gcc/cgraph.h:1741:1: warning: 'cgraph_edge' defined as a class here but
previously declared as a struct; this is
      valid, but may result in linker errors under the Microsoft C++ ABI
[-Wmismatched-tags]
class GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"),
^
../../gcc/cgraph.h:903:1: note: did you mean class here?
struct cgraph_edge;
^~~~~~
class
../../gcc/coretypes.h:144:1: note: did you mean class here?
struct cgraph_edge;
^~~~~~
class
In file included from ../../gcc/c/gimple-parser.c:28:
../../gcc/cgraph.h:2254:10: warning: struct 'cgraph_edge' was previously
declared as a class; this is valid, but may
      result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
  friend struct cgraph_edge;
         ^
../../gcc/cgraph.h:1742:16: note: previous use is here
           for_user)) cgraph_edge
                      ^
../../gcc/cgraph.h:2254:10: note: did you mean class here?
  friend struct cgraph_edge;
         ^~~~~~
         class
../../gcc/cgraph.h:2662:32: warning: struct 'cgraph_edge' was previously
declared as a class; this is valid, but may
      result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
void initialize_inline_failed (struct cgraph_edge *);
                               ^
../../gcc/cgraph.h:1742:16: note: previous use is here
           for_user)) cgraph_edge
                      ^
../../gcc/cgraph.h:2662:32: note: did you mean class here?
void initialize_inline_failed (struct cgraph_edge *);
                               ^~~~~~
                               class
../../gcc/cgraph.h:2663:28: warning: struct 'cgraph_edge' was previously
declared as a class; this is valid, but may
      result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
bool speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining);
                           ^
../../gcc/cgraph.h:1742:16: note: previous use is here
           for_user)) cgraph_edge
                      ^
../../gcc/cgraph.h:2663:28: note: did you mean class here?
bool speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining);
                           ^~~~~~
                           class
In file included from ../../gcc/c/gimple-parser.c:44:
In file included from ../../gcc/tree-vrp.h:23:
../../gcc/value-range.h:347:1: error: static declaration of 'gt_ggc_mx' follows
non-static declaration
gt_ggc_mx (int_range<N> *x)
^
../../gcc/value-range.h:150:37: note: previous declaration is here
  template <unsigned X> friend void gt_ggc_mx (int_range<X> *);
                                    ^
../../gcc/value-range.h:358:1: error: static declaration of 'gt_pch_nx' follows
non-static declaration
gt_pch_nx (int_range<N> *x)
^
../../gcc/value-range.h:151:37: note: previous declaration is here
  template <unsigned X> friend void gt_pch_nx (int_range<X> *);
                                    ^
../../gcc/value-range.h:369:1: error: static declaration of 'gt_pch_nx' follows
non-static declaration
gt_pch_nx (int_range<N> *x, gt_pointer_operator op, void *cookie)
^
../../gcc/value-range.h:152:37: note: previous declaration is here
  template <unsigned X> friend void gt_pch_nx (int_range<X> *,
                                    ^
In file included from ../../gcc/c/gimple-parser.c:49:
../../gcc/gimple.h:2599:10: warning: array index 1 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
  return gs->op[1];
         ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2631:3: warning: array index 1 is past the end of the array
(which contains 1 element) [-Warray-bounds]
  gs->op[1] = rhs;
  ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2649:12: warning: array index 2 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
    return gs->op[2];
           ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2669:11: warning: array index 2 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
  return &gs->op[2];
          ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2686:3: warning: array index 2 is past the end of the array
(which contains 1 element) [-Warray-bounds]
  gs->op[2] = rhs;
  ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2703:12: warning: array index 3 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
    return gs->op[3];
           ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2723:11: warning: array index 3 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
  return &ass->op[3];
          ^       ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:2733:3: warning: array index 3 is past the end of the array
(which contains 1 element) [-Warray-bounds]
  gs->op[3] = rhs;
  ^      ~
../../gcc/gimple.h:337:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:3095:10: warning: array index 1 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
  return gs->op[1];
         ^      ~
../../gcc/gimple.h:362:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:3128:3: warning: array index 1 is past the end of the array
(which contains 1 element) [-Warray-bounds]
  gs->op[1] = fn;
  ^      ~
../../gcc/gimple.h:362:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:3138:3: warning: array index 1 is past the end of the array
(which contains 1 element) [-Warray-bounds]
  gs->op[1] = build1_loc (gimple_location (gs), ADDR_EXPR,
  ^      ~
../../gcc/gimple.h:362:3: note: array 'op' declared here
  tree GTY((length ("%h.num_ops"))) op[1];
  ^
../../gcc/gimple.h:3199:10: warning: array index 2 is past the end of the array
(which contains 1 element)
      [-Warray-bounds]
  return gs->op[2];

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
@ 2020-08-10  7:14 ` juergen.reuter at desy dot de
  2020-08-10  7:16 ` juergen.reuter at desy dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-10  7:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jürgen Reuter <juergen.reuter at desy dot de> ---
It seems that the problem is in the declaration of the following variables in
value_range.h:
  template <unsigned X> friend void gt_ggc_mx (int_range<X> *);
  template <unsigned X> friend void gt_pch_nx (int_range<X> *);
  template <unsigned X> friend void gt_pch_nx (int_range<X> *,
                                               gt_pointer_operator, void *);
  // ?? hash-traits.h has its own extern for these, which is causing            
  // them to never be picked up by the templates.  For now, define              
  // elsewhere.                                                                 
  //template<unsigned X> friend void gt_ggc_mx (int_range<X> *&);               
  //template<unsigned X> friend void gt_pch_nx (int_range<X> *&);            

This declaration is commented out, but above it is set, which looks suspicious.
If I comment out the three declarations for friend void gt_ggc_mx, then the
code seems to compile.

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
  2020-08-10  7:14 ` [Bug c/96540] " juergen.reuter at desy dot de
@ 2020-08-10  7:16 ` juergen.reuter at desy dot de
  2020-08-10  7:41 ` juergen.reuter at desy dot de
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-10  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Most likely this was that commit:
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 150)   template
<unsigned X> friend void gt_ggc_mx (int_range<X> *);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 151)   template
<unsigned X> friend void gt_pch_nx (int_range<X> *);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 152)   template
<unsigned X> friend void gt_pch_nx (int_range<X> *,
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 153)                 
                       gt_pointer_operator, void *);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 154)   // ??
hash-traits.h has its own extern for these, which is causing
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 155)   // them to
never be picked up by the templates.  For now, define
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 156)   // elsewhere.
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 157)  
//template<unsigned X> friend void gt_ggc_mx (int_range<X> *&);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 158)  
//template<unsigned X> friend void gt_pch_nx (int_range<X> *&);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 159)   friend void
gt_ggc_mx (int_range<1> *&);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 160)   friend void
gt_pch_nx (int_range<1> *&);
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 161) 
4ba9fb0a3e65 (Aldy Hernandez    2020-07-30 11:30:18 +0200 162)   tree
m_ranges[N*2];

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
  2020-08-10  7:14 ` [Bug c/96540] " juergen.reuter at desy dot de
  2020-08-10  7:16 ` juergen.reuter at desy dot de
@ 2020-08-10  7:41 ` juergen.reuter at desy dot de
  2020-08-10  8:03 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-10  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Just uncommenting the declarations doesn't help because later on compilation
fails with
n file included from gtype-desc.c:52:
../../gcc/value-range.h:352:21: error: 'm_ranges' is a private member of
'int_range<1>'
      gt_ggc_mx (x->m_ranges[i * 2]);
                    ^

because the friend declaration is missing. :(

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
                   ` (2 preceding siblings ...)
  2020-08-10  7:41 ` juergen.reuter at desy dot de
@ 2020-08-10  8:03 ` aldyh at gcc dot gnu.org
  2020-08-10  8:10 ` juergen.reuter at desy dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-08-10  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Does this patch fix the problem?

https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551660.html

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
                   ` (3 preceding siblings ...)
  2020-08-10  8:03 ` aldyh at gcc dot gnu.org
@ 2020-08-10  8:10 ` juergen.reuter at desy dot de
  2020-08-10  8:50 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-10  8:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jürgen Reuter <juergen.reuter at desy dot de> ---
(In reply to Aldy Hernandez from comment #4)
> Does this patch fix the problem?
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551660.html

It looks like, still compiling. In the meantime I changed this in the same way,
as the error message clearly showed that there is both a dynamic and a static
declaration present. I'm waiting for the build to complete and report back.

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
                   ` (4 preceding siblings ...)
  2020-08-10  8:10 ` juergen.reuter at desy dot de
@ 2020-08-10  8:50 ` marxin at gcc dot gnu.org
  2020-08-10 12:33 ` juergen.reuter at desy dot de
  2020-08-10 13:01 ` aldyh at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-08-10  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
*** Bug 96541 has been marked as a duplicate of this bug. ***

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
                   ` (5 preceding siblings ...)
  2020-08-10  8:50 ` marxin at gcc dot gnu.org
@ 2020-08-10 12:33 ` juergen.reuter at desy dot de
  2020-08-10 13:01 ` aldyh at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: juergen.reuter at desy dot de @ 2020-08-10 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jürgen Reuter <juergen.reuter at desy dot de> ---
(In reply to Aldy Hernandez from comment #4)
> Does this patch fix the problem?
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551660.html

Yes, with that fix (as anticipated by you) build and bootstrap work.

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

* [Bug c/96540] gcc fails to build on Darwin 19.6.0
  2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
                   ` (6 preceding siblings ...)
  2020-08-10 12:33 ` juergen.reuter at desy dot de
@ 2020-08-10 13:01 ` aldyh at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-08-10 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Fixed upstream.

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

end of thread, other threads:[~2020-08-10 13:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-09 10:59 [Bug c/96540] New: gcc fails to build on Darwin 19.6.0 juergen.reuter at desy dot de
2020-08-10  7:14 ` [Bug c/96540] " juergen.reuter at desy dot de
2020-08-10  7:16 ` juergen.reuter at desy dot de
2020-08-10  7:41 ` juergen.reuter at desy dot de
2020-08-10  8:03 ` aldyh at gcc dot gnu.org
2020-08-10  8:10 ` juergen.reuter at desy dot de
2020-08-10  8:50 ` marxin at gcc dot gnu.org
2020-08-10 12:33 ` juergen.reuter at desy dot de
2020-08-10 13:01 ` 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).