[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-11-05 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #71 from Iain Sandoe  ---
(In reply to Iain Sandoe from comment #70)

> 
> powerpc64 darwin is *much* less tested than the 32b variant.
> 
> I don't have any access to my ppc64 machine for the next week but... it
> looks like our gcc exes are now getting too big for the 'our of the tin'
> linker.
> 
> The Apple ld64 impl. was quite broken for liner branch islanding on ppc64 -
> there were some work-arounds from the mac ports / fink folks.  However, I
> actually spent some time on it and more or less re-wrote the
> branch-islanding code - that code / and a bootstrap toolchain is available
> from my github account.  
> 
> https://github.com/iains/darwin-xtools (code)
> https://github.com/iains/darwin-gcc-5/releases (release for 5.3)
> 
> I have a bunch of updates locally - but need to be cleaned up and released
> .. time as ever the issue there.

caveats:
1. I have used these tools to build large 32b exes ( > 120Mb linked size)
2. the branch code and the relocations are the same for powerpc64 as for
powerpc on Darwin9 - so one might expect it to 'just work' using those
tools
.. but it hasn't been tested .. and as they say "if it ain't tested, it's
broke".

If it doesn't work for you - please file something on my github issues - it's
nothing to do with GCC :)

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-11-05 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #70 from Iain Sandoe  ---
(In reply to Douglas Mencken from comment #69)
> (In reply to Iain Sandoe from comment #64)
> > so all languages, m32/m64, --enable-checking=all,rtl,tree trunk bootstrap
> > completed without error (with the patch above + one to enable Ada to work on
> > Darwin9).
> 
> How do you build for ppc64? Because that’s what I got


I didn't :-) .. standard multilb build on powerpc-darwin builds (and tests) the
64b variants of the libraries - it doesn't build 64b tools.

> 
> ccache /Developer/usr/bin/g++-4.2 -m64 -std=gnu++98 -no-pie   -g  -DIN_GCC  
> -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
> -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
> -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
> -Wno-overlength-strings   -DHAVE_CONFIG_H  -o cc1 c/c-lang.o
> c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o
> c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o
> c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o
> c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o
> c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o
> c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o
> c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o
> c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o
> c-family/c-warn.o c-family/c-spellcheck.o darwin-c.o rs6000-c.o \
> cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a
> ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a
> ../libcpp/libcpp.a  -liconv ../libbacktrace/.libs/libbacktrace.a
> ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./isl/.libs  -lisl
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./gmp/.libs
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpfr/src/.libs
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpc/src/.libs -lmpc
> -lmpfr -lgmp   -L./../zlib -lz
> ccache /Developer/usr/bin/g++-4.2 -m64 -std=gnu++98 -no-pie   -g  -DIN_GCC  
> -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
> -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
> -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
> -Wno-overlength-strings   -DHAVE_CONFIG_H  -o cc1plus \
> cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o 
> cp/constexpr.o
> cp/constraint.o cp/cp-gimplify.o cp/cp-objcp-common.o cp/cp-ubsan.o cp/cvt.o
> cp/cxx-pretty-print.o cp/decl.o cp/decl2.o cp/dump.o cp/error.o cp/except.o
> cp/expr.o cp/friend.o cp/init.o cp/lambda.o cp/lex.o cp/logic.o cp/mangle.o
> cp/method.o cp/name-lookup.o cp/optimize.o cp/parser.o cp/pt.o cp/ptree.o
> cp/repo.o cp/rtti.o cp/search.o cp/semantics.o cp/tree.o cp/typeck.o
> cp/typeck2.o cp/vtable-class-hierarchy.o attribs.o incpath.o
> c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
> c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o
> c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
> c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
> c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o
> c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o
> c-family/c-spellcheck.o darwin-c.o rs6000-c.o cc1plus-checksum.o
> libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
> ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a  -liconv
> ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
> ../libdecnumber/libdecnumber.a 
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./isl/.libs  -lisl
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./gmp/.libs
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpfr/src/.libs
> -L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpc/src/.libs -lmpc
> -lmpfr -lgmp   -L./../zlib -lz
> ld: bl out of range (-17219580 max is +/-16M) from lookup_attribute(char
> const*, tree_node*)at 0x10106DA48 in __text of libbackend.a(stor-layout.o)
> to private_lookup_attribute(char const*, unsigned long, tree_node*)at
> 0x11A9C in __text of  attribs.o in lookup_attribute(char const*,
> tree_node*)from libbackend.a(stor-layout.o)
> collect2: ld returned 1 exit status
> make[3]: *** [cc1] Error 1
> make[3]: *** Waiting for unfinished jobs
> ld: bl out of range (-16777352 max is +/-16M) from
> gt_pch_nx_string_pool_data(void*) at 0x101271C9C in __text of
> libbackend.a(stringpool.o) to gt_pch_nx_lang_tree_node(void*) at 0x100271D0C
> in __text of  cp/tree.o in gt_pch_nx_string_pool_data(void*) from
> libbackend.a(stringpool.o)
> collect2: ld returned 1 exit status
> make[3]: *** [cc1plus] Error 1
> rm gcc.pod
> make[2]: *** [all-stage1-gcc] Error 2
> make[1]: *** [stage1-bubble] Error 2
> make: *** 

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-11-05 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #69 from Douglas Mencken  ---
(In reply to Iain Sandoe from comment #64)
> so all languages, m32/m64, --enable-checking=all,rtl,tree trunk bootstrap
> completed without error (with the patch above + one to enable Ada to work on
> Darwin9).

How do you build for ppc64? Because that’s what I got

ccache /Developer/usr/bin/g++-4.2 -m64 -std=gnu++98 -no-pie   -g  -DIN_GCC   
-fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H  -o cc1 c/c-lang.o
c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o
c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o
c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o
c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o
c-family/c-spellcheck.o darwin-c.o rs6000-c.o \
  cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a
../libcpp/libcpp.a  -liconv ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./isl/.libs  -lisl
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./gmp/.libs
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpfr/src/.libs
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpc/src/.libs -lmpc
-lmpfr -lgmp   -L./../zlib -lz
ccache /Developer/usr/bin/g++-4.2 -m64 -std=gnu++98 -no-pie   -g  -DIN_GCC   
-fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H  -o cc1plus \
  cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/class.o
cp/constexpr.o cp/constraint.o cp/cp-gimplify.o cp/cp-objcp-common.o
cp/cp-ubsan.o cp/cvt.o cp/cxx-pretty-print.o cp/decl.o cp/decl2.o cp/dump.o
cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o cp/lambda.o cp/lex.o
cp/logic.o cp/mangle.o cp/method.o cp/name-lookup.o cp/optimize.o cp/parser.o
cp/pt.o cp/ptree.o cp/repo.o cp/rtti.o cp/search.o cp/semantics.o cp/tree.o
cp/typeck.o cp/typeck2.o cp/vtable-class-hierarchy.o attribs.o incpath.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o
c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o
c-family/c-spellcheck.o darwin-c.o rs6000-c.o cc1plus-checksum.o libbackend.a
main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a  -liconv
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a 
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./isl/.libs  -lisl
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./gmp/.libs
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpfr/src/.libs
-L/Volumes/hfsplushd/Development/gcc-toolchain/_build/./mpc/src/.libs -lmpc
-lmpfr -lgmp   -L./../zlib -lz
ld: bl out of range (-17219580 max is +/-16M) from lookup_attribute(char
const*, tree_node*)at 0x10106DA48 in __text of libbackend.a(stor-layout.o) to
private_lookup_attribute(char const*, unsigned long, tree_node*)at 0x11A9C
in __text of  attribs.o in lookup_attribute(char const*, tree_node*)from
libbackend.a(stor-layout.o)
collect2: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: *** Waiting for unfinished jobs
ld: bl out of range (-16777352 max is +/-16M) from
gt_pch_nx_string_pool_data(void*) at 0x101271C9C in __text of
libbackend.a(stringpool.o) to gt_pch_nx_lang_tree_node(void*) at 0x100271D0C in
__text of  cp/tree.o in gt_pch_nx_string_pool_data(void*) from
libbackend.a(stringpool.o)
collect2: ld returned 1 exit status
make[3]: *** [cc1plus] Error 1
rm gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-11-03 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Douglas Mencken  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #68 from Douglas Mencken  ---
It is fixed

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-28 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #67 from Iain Sandoe  ---
Author: iains
Date: Sun Oct 28 10:02:06 2018
New Revision: 265569

URL: https://gcc.gnu.org/viewcvs?rev=265569=gcc=rev
Log:
darwin - fix powerpc-darwin stack alignment issue

2018-10-28  Iain Sandoe  

backport from mainline.
2018-10-28  Iain Sandoe  

PR target/85669
* config/rs6000/darwin.h (STACK_BOUNDARY): New.
(RS6000_STARTING_FRAME_OFFSET): Adjust to preserve 16byte alignment.
(STACK_DYNAMIC_OFFSET): Likewise.


Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/config/rs6000/darwin.h

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-28 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #66 from Iain Sandoe  ---
Author: iains
Date: Sun Oct 28 09:25:43 2018
New Revision: 265568

URL: https://gcc.gnu.org/viewcvs?rev=265568=gcc=rev
Log:
darwin - fix powerpc-darwin stack alignments

2018-10-28  Iain Sandoe  

PR target/85669
* config/rs6000/darwin.h (STACK_BOUNDARY): New.
(RS6000_STARTING_FRAME_OFFSET): Adjust to preserve 16byte alignment.
(STACK_DYNAMIC_OFFSET): Likewise.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/darwin.h

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-27 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #65 from Segher Boessenkool  ---
Iain: This is fine for trunk and all open branches you want it on.  Thanks!

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-27 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Iain Sandoe  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED

--- Comment #64 from Iain Sandoe  ---
so all languages, m32/m64, --enable-checking=all,rtl,tree trunk bootstrap
completed without error (with the patch above + one to enable Ada to work on
Darwin9).

"Only" 16h of CPU time on a 2G5 cpu ;)

Smoke-tested only; full suite will take "some time".

So - at least w.r.t the boostrap bug, I'm declaring victory for trunk/8.x and
will do a second revision for 7.x (unless it can be proven not to be needed
there).

@segher - still OK for application or would you like me to post the revised
patch?

(I want to modify the comment slightly to note that the FRAME_GROWS_DOWNWARD
case is the only one relevant here, which is why the other arm of the original
ternary got removed).

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-27 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Douglas Mencken  changed:

   What|Removed |Added

  Attachment #44902|0   |1
is obsolete||

--- Comment #63 from Douglas Mencken  ---
Created attachment 44909
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44909=edit
8.2iain-pr78468.s

Assembly of pr78468.s by GCC 8.2 with Iain’s patch

--- 8.2vanilla-pr78468.s
+++ 8.2iain-pr78468.s
@@ -85,7 +85,7 @@
li r7,0
li r5,0
li r4,0
-   addi r2,r1,72
+   addi r2,r1,80
stw r6,60(r1)
stw r2,56(r1)
li r6,0
@@ -118,7 +118,7 @@
li r8,0
li r5,0
li r4,0
-   addi r2,r1,72
+   addi r2,r1,80
stw r6,64(r1)
stw r7,60(r1)
li r3,0
@@ -152,7 +152,7 @@
li r7,0
li r5,0
li r4,0
-   addi r2,r1,72
+   addi r2,r1,80
stw r6,60(r1)
stw r2,56(r1)
li r6,0
@@ -185,7 +185,7 @@
li r8,0
li r5,0
li r4,0
-   addi r2,r1,72
+   addi r2,r1,80
stw r6,64(r1)
stw r7,60(r1)
li r3,0
@@ -286,7 +286,7 @@
li r7,0
li r5,0
li r4,0
-   addi r2,r1,103
+   addi r2,r1,111
stw r6,60(r1)
rlwinm r2,r2,0,0,26
li r6,0
@@ -320,7 +320,7 @@
li r8,0
li r5,0
li r4,0
-   addi r2,r1,103
+   addi r2,r1,111
stw r6,64(r1)
rlwinm r2,r2,0,0,26
stw r7,60(r1)

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-27 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #62 from Douglas Mencken  ---
(In reply to Iain Sandoe from comment #61)
> Created attachment 44908 [details]
> Proposed 8.x patch
> 
> here is the revised patch for the post wi::int_traits world. Works For Me(tm)
> 
> Please confirm for your use-case.

It works for me™ too

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-27 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Iain Sandoe  changed:

   What|Removed |Added

  Attachment #44901|0   |1
is obsolete||
 Status|NEW |WAITING
   Assignee|unassigned at gcc dot gnu.org  |iains at gcc dot gnu.org

--- Comment #61 from Iain Sandoe  ---
Created attachment 44908
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44908=edit
Proposed 8.x patch

here is the revised patch for the post wi::int_traits world. Works For Me(tm)

Please confirm for your use-case.

I expect this variant will be suitable for trunk (testing later)

A slightly different version will be needed for 7.x (TBD).

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #60 from Iain Sandoe  ---
(In reply to Douglas Mencken from comment #59)
> (In reply to Segher Boessenkool from comment #58)
> 
> > This patch
> > (https://gcc.gnu.org/ml/gcc-testresults/2017-01/txtNTsImfm9sQ.txt) is okay
> > for trunk and all open branches, btw.
> 
> It needs some update, as example after r254003

i've reworked it and testing now

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #59 from Douglas Mencken  ---
(In reply to Segher Boessenkool from comment #58)

> This patch
> (https://gcc.gnu.org/ml/gcc-testresults/2017-01/txtNTsImfm9sQ.txt) is okay
> for trunk and all open branches, btw.

It needs some update, as example after r254003

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #58 from Segher Boessenkool  ---
(In reply to Iain Sandoe from comment #53)
> (In reply to Wilco from comment #52)
> > (In reply to Segher Boessenkool from comment #50)
> > > The generic code rounded up the allocation size twice, and that isn't 
> > > needed.
> > > 
> > > The problem has been solved for other targets before; a patch for Darwin 
> > > is
> > > at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 
> > > 0001.
> > 
> > Yes that looks correct indeed. No idea why it wasn't committed... 
> 
> long story to do with water coming through the office ceiling, relocation to
> a place without a PPC machine available and then someone claiming that they
> had bootstrap OK without that patch (which surprised me).
> 
> I will try to check the situation on 8.2.1 + back ports from trunk over the
> weekend.
> if that patch is still good then we should be able to get it into trunk and
> 8/7 as needed it's entirely Darwin-local

This patch (https://gcc.gnu.org/ml/gcc-testresults/2017-01/txtNTsImfm9sQ.txt)
is okay for trunk and all open branches, btw.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #57 from Segher Boessenkool  ---
The blrl thing ("skip a return") doesn't kill the return stack; all CPUs
with a return stack can recover it here afaik.  Recovery of course takes
a little time still.  Newer CPUs predict BL+4 as not-taken (but finish it
as if the prediction was correct); older CPUs do not create a link stack
entry if BI=31.  So we emit "bcl 20,31,$+4" for this, which works optimally
in all cases.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #56 from Wilco  ---
(In reply to Douglas Mencken from comment #55)
> (In reply to Wilco from comment #52)
> > (In reply to Segher Boessenkool from comment #50)
> > > The generic code rounded up the allocation size twice, and that isn't 
> > > needed.
> > > 
> > > The problem has been solved for other targets before; a patch for Darwin 
> > > is
> > > at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 
> > > 0001.
> > 
> > Yes that looks correct indeed. No idea why it wasn't committed... It looks
> > like the patch in comment 16 didn't work because rs6000_stack_info does its
> > own calculation of this, so aligning when alloca isn't used will get
> > incorrect frame offsets:
> > 
> >   info->fixed_size   = RS6000_SAVE_AREA;
> >   info->vars_size= RS6000_ALIGN (get_frame_size (), 8);
> >   if (cfun->calls_alloca)
> > info->parm_size  =
> >   RS6000_ALIGN (crtl->outgoing_args_size + info->fixed_size,
> > STACK_BOUNDARY / BITS_PER_UNIT) - info->fixed_size;
> >   else
> > info->parm_size  = RS6000_ALIGN (crtl->outgoing_args_size,
> >  TARGET_ALTIVEC ? 16 : 8);
> 
> Is this logic wrong? So what is this supposed to be?

That's correct code, but it is essential that STARTING_FRAME_OFFSET does
exactly the same, and STACK_DYNAMIC_OFFSET aligns always.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #55 from Douglas Mencken  ---
(In reply to Wilco from comment #52)
> (In reply to Segher Boessenkool from comment #50)
> > The generic code rounded up the allocation size twice, and that isn't 
> > needed.
> > 
> > The problem has been solved for other targets before; a patch for Darwin is
> > at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 
> > 0001.
> 
> Yes that looks correct indeed. No idea why it wasn't committed... It looks
> like the patch in comment 16 didn't work because rs6000_stack_info does its
> own calculation of this, so aligning when alloca isn't used will get
> incorrect frame offsets:
> 
>   info->fixed_size   = RS6000_SAVE_AREA;
>   info->vars_size= RS6000_ALIGN (get_frame_size (), 8);
>   if (cfun->calls_alloca)
> info->parm_size  =
>   RS6000_ALIGN (crtl->outgoing_args_size + info->fixed_size,
> STACK_BOUNDARY / BITS_PER_UNIT) - info->fixed_size;
>   else
> info->parm_size  = RS6000_ALIGN (crtl->outgoing_args_size,
>  TARGET_ALTIVEC ? 16 : 8);

Is this logic wrong? So what is this supposed to be?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #54 from Douglas Mencken  ---
(In reply to Wilco from comment 51)
> (In reply to Segher Boessenkool from comment 49)
> > (In reply to Douglas Mencken from comment 46)
> > > Yeah, PowerPC doesn’t have addressing via PC, thus it requires to do 
> > > tricks
> > > like that
> > 
> > No, we don't have to do such strange code.  The usual way is to do a call
> > to the next instruction, and then a mflr.  No blrl needed.
> > 
> > This _is_ an excuse to use that fun instruction though!
> 
> That would kill the return stack though unless the hardware special cases a
> call to next instruction as not being a call but providing the PC.

Nope. bl does nothing to any memory pointed by any register, it just pust
current pc+4 into lr, and then updates pc with its argument as relative offset.
I saw the huge code with a lot of subroutines where stack wasn’t used at all
(sure such functions are not reentrant), handling call chain by gprs 13 to 29,
for depths less than 16 calls it is very possible

Code like bl +8, mflr would just result in larger offsets to data in text.
Anyway I don’t get an idea why it may be needed at all. Data in .data
(read-only too), code in .text. Simple, easy and nice

(In reply to Segher Boessenkool from comment 50)
> The generic code rounded up the allocation size twice, and that isn't needed.

(In reply to Wilco from comment 48)
> 16 is correct - an alloca of 16 should allocate 16 bytes, not 32. If the
> size were incorrect it would fail on all targets, and not only when
> STACK_DYNAMIC_OFFSET is not correctly aligned. What happens is that the
> extra padding due to adding 22 rather than 15 helps to hide the bug.

Okay, I got it. 22 (32) is too much, 15 (16) is nice

> The problem has been solved for other targets before; a patch for Darwin is
> at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 0001.

It does worth trying

 #undef STARTING_FRAME_OFFSET
 #define STARTING_FRAME_OFFSET  \
   (FRAME_GROWS_DOWNWARD   
\
? 0 \
-   : (RS6000_ALIGN (crtl->outgoing_args_size, 16)  \
-  + RS6000_SAVE_AREA))
+   : (cfun->calls_alloca   \
+  ? RS6000_ALIGN (crtl->outgoing_args_size + RS6000_SAVE_AREA, 16) \
+  : (RS6000_ALIGN (crtl->outgoing_args_size, 16) + RS6000_SAVE_AREA)))

Meanwhile, what was the problem to merge these patches a year ago? My previous
pr84113 was fixed by 2nd patch there, yet the 1st

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #53 from Iain Sandoe  ---
(In reply to Wilco from comment #52)
> (In reply to Segher Boessenkool from comment #50)
> > The generic code rounded up the allocation size twice, and that isn't 
> > needed.
> > 
> > The problem has been solved for other targets before; a patch for Darwin is
> > at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 
> > 0001.
> 
> Yes that looks correct indeed. No idea why it wasn't committed... 

long story to do with water coming through the office ceiling, relocation to a
place without a PPC machine available and then someone claiming that they had
bootstrap OK without that patch (which surprised me).

I will try to check the situation on 8.2.1 + back ports from trunk over the
weekend.
if that patch is still good then we should be able to get it into trunk and 8/7
as needed it's entirely Darwin-local

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #52 from Wilco  ---
(In reply to Segher Boessenkool from comment #50)
> The generic code rounded up the allocation size twice, and that isn't needed.
> 
> The problem has been solved for other targets before; a patch for Darwin is
> at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 0001.

Yes that looks correct indeed. No idea why it wasn't committed... It looks like
the patch in comment 16 didn't work because rs6000_stack_info does its own
calculation of this, so aligning when alloca isn't used will get incorrect
frame offsets:

  info->fixed_size   = RS6000_SAVE_AREA;
  info->vars_size= RS6000_ALIGN (get_frame_size (), 8);
  if (cfun->calls_alloca)
info->parm_size  =
  RS6000_ALIGN (crtl->outgoing_args_size + info->fixed_size,
STACK_BOUNDARY / BITS_PER_UNIT) - info->fixed_size;
  else
info->parm_size  = RS6000_ALIGN (crtl->outgoing_args_size,
 TARGET_ALTIVEC ? 16 : 8);

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #51 from Wilco  ---
(In reply to Segher Boessenkool from comment #49)
> (In reply to Douglas Mencken from comment #46)
> > Yeah, PowerPC doesn’t have addressing via PC, thus it requires to do tricks
> > like that
> 
> No, we don't have to do such strange code.  The usual way is to do a call
> to the next instruction, and then a mflr.  No blrl needed.
> 
> This _is_ an excuse to use that fun instruction though!

That would kill the return stack though unless the hardware special cases a
call to next instruction as not being a call but providing the PC.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #50 from Segher Boessenkool  ---
The generic code rounded up the allocation size twice, and that isn't needed.

The problem has been solved for other targets before; a patch for Darwin is
at https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html , patch 0001.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #49 from Segher Boessenkool  ---
(In reply to Douglas Mencken from comment #46)
> Yeah, PowerPC doesn’t have addressing via PC, thus it requires to do tricks
> like that

No, we don't have to do such strange code.  The usual way is to do a call
to the next instruction, and then a mflr.  No blrl needed.

This _is_ an excuse to use that fun instruction though!

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #48 from Wilco  ---
(In reply to Douglas Mencken from comment #44)
> I got assembly of pr78468.c from various versions of GCC
> 
> • 7.3 produces absolutely the same as patched 8.2
> • 6.4 produces slightly different assembly with stmw & lmw and different
> sequence of instructions, but numbers like in “addi r2,r1,103” are the same
> • 4.2.1 can’t compile it at all pr78468.c:9: error: expected ‘=’, ‘,’, ‘;’,
> ‘asm’ or ‘__attribute__’ before ‘uintptr_t’
> 
> (In reply to Wilco from comment #43)
> > No the problem is not in this code. It's STACK_DYNAMIC_OFFSET which is 
> > wrong.
> 
> I can’t get where is the value of STACK_DYNAMIC_OFFSET in published assembly
> and why do you think it is wrong

The value is used to create the alloca pointer which has to be r1 +
STACK_DYNAMIC_OFFSET aligned to at least STACK_BOUNDARY.

> It seems that the problem is in fact that your version of
> get_dynamic_stack_size from explow.c (introduced with r251713) gives out too
> small values, for example in _t1_a8 it is fifteen “addi r3,r3,15” while ages
> before that it worked as being “addi r3,r3,22”
> 
> - addi r3,r3,15
> + addi r3,r3,22

No my version uses exactly the correct size (adding 15 and clearing the bottom
4 bits rounds up to a multiple of 16).

> And aligning looks okay, it is then handled by code for
> 
> #define RS6000_ALIGN(n,a) ROUND_UP ((n), (a))
> #define ROUND_UP(x,y) (((x) + (y) - 1) & ~((y) - 1))
> 
> part of which is rlwinm and such
> 
> (16 + 15) & ~15 = 16
> (16 + 22) & ~15 = 32
> 
> Thus for your version of get_dynamic_stack_size that size is 16 here, but
> for previous ones it is 32. And eventually this leads to fail for such
> built-ins as acos, floor, 

16 is correct - an alloca of 16 should allocate 16 bytes, not 32. If the size
were incorrect it would fail on all targets, and not only when
STACK_DYNAMIC_OFFSET is not correctly aligned. What happens is that the extra
padding due to adding 22 rather than 15 helps to hide the bug.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #47 from Wilco  ---
(In reply to Douglas Mencken from comment #45)
> (In reply to self from comment #44)
> 
> > I can’t get where is the value of STACK_DYNAMIC_OFFSET in published assembly
> > and why do you think it is wrong
> 
> Most likely this value is shown as 96 in “addi r1,r30,96” (80 for _t1 and
> _t2) of epilogues
> 
>   bl _t1
>   addi r1,r30,96
>   lwz r0,8(r1)
>   lwz r30,-8(r1)
>   lwz r31,-4(r1)
>   mtlr r0
>   blr

No, it's the value of r2 before the call to _t1 (like I quoted in comment 32):

t1_a4
addi r2,r1,72  -> 72 % 16 != 0 (correct value would be 64)
stw r6,60(r1)
stw r2,56(r1)

As long as STACK_DYNAMIC_OFFSET isn't aligned, the alloca pointer won't be
setup correctly, and this can cause it to corrupt other data in the function.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #46 from Douglas Mencken  ---
(In reply to Wilco from comment #38)

> You can have data in text sections, including bytes and half words. Even if
> instructions aligned automatically, the function label might be unaligned if
> it was preceded by a byte.

I found example of such code

** -- Find_GetSectionInfo_Symbol -- **
** input: (none)
** output: (see Query_CFM_FindSymbol)
**  **
Find_GetSectionInfo_Symbol:
mflrr4
bl  _Get_Data_Address
mflrr3
mtlrr4
la  r3,@str_getSectionInfo-@data(r3)
b   Query_CFM_FindSymbol

** -- _Get_Data_Address --- **
** output: LR = address of data (below)
**  **
_Get_Data_Address:
blrl

**  **

@data:
@str_callUP:
DC.B17,"CallUniversalProc"
@str_callOSTrapUP:
DC.B23,"CallOSTrapUniversalProc"
@str_getSectionInfo:
DC.B18,"FragGetSectionInfo",0

Yeah, PowerPC doesn’t have addressing via PC, thus it requires to do tricks
like that

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #45 from Douglas Mencken  ---
(In reply to self from comment #44)

> I can’t get where is the value of STACK_DYNAMIC_OFFSET in published assembly
> and why do you think it is wrong

Most likely this value is shown as 96 in “addi r1,r30,96” (80 for _t1 and _t2)
of epilogues

bl _t1
addi r1,r30,96
lwz r0,8(r1)
lwz r30,-8(r1)
lwz r31,-4(r1)
mtlr r0
blr

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-26 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #44 from Douglas Mencken  ---
I got assembly of pr78468.c from various versions of GCC

• 7.3 produces absolutely the same as patched 8.2
• 6.4 produces slightly different assembly with stmw & lmw and different
sequence of instructions, but numbers like in “addi r2,r1,103” are the same
• 4.2.1 can’t compile it at all pr78468.c:9: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘uintptr_t’

(In reply to Wilco from comment #43)
> No the problem is not in this code. It's STACK_DYNAMIC_OFFSET which is wrong.

I can’t get where is the value of STACK_DYNAMIC_OFFSET in published assembly
and why do you think it is wrong

It seems that the problem is in fact that your version of
get_dynamic_stack_size from explow.c (introduced with r251713) gives out too
small values, for example in _t1_a8 it is fifteen “addi r3,r3,15” while ages
before that it worked as being “addi r3,r3,22”

-   addi r3,r3,15
+   addi r3,r3,22

And aligning looks okay, it is then handled by code for

#define RS6000_ALIGN(n,a) ROUND_UP ((n), (a))
#define ROUND_UP(x,y) (((x) + (y) - 1) & ~((y) - 1))

part of which is rlwinm and such

(16 + 15) & ~15 = 16
(16 + 22) & ~15 = 32

Thus for your version of get_dynamic_stack_size that size is 16 here, but for
previous ones it is 32. And eventually this leads to fail for such built-ins as
acos, floor, 

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #43 from Wilco  ---
(In reply to Douglas Mencken from comment #42)
> (In reply to Wilco from comment #41)
> 
> > So what is the disassembly now?
> 
> $ /Developer/GCC/8.2p/PowerPC/32bit/bin/gcc -O2 -fno-inline pr78468.c
> -save-temps
> $ mv pr78468.s ~/
> $ diff -u ~/8.2patched-pr78468.s ~/pr78468.s
> 
> Shows nothing, so they are identical

So that patch didn't do anything to fix STACK_DYNAMIC_OFFSET then. If it has no
effect then is that header really used?

> > The 2nd diff still shows the original unaligned STACK_DYNAMIC_OFFSET.
> 
> Second is vanilla 8.2, unpatched, which is marked with “-” in diff I posted
> 
> Possible problem is that in
> 
> -  if (size_align > known_align)
> - size_align = known_align;
> +  if (extra && size_align > BITS_PER_UNIT)
> +size_align = BITS_PER_UNIT;
> 
> you forgot if (extra /* assumed >0 */

No the problem is not in this code. It's STACK_DYNAMIC_OFFSET which is wrong.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #42 from Douglas Mencken  ---
(In reply to Wilco from comment #41)

> So what is the disassembly now?

$ /Developer/GCC/8.2p/PowerPC/32bit/bin/gcc -O2 -fno-inline pr78468.c
-save-temps
$ mv pr78468.s ~/
$ diff -u ~/8.2patched-pr78468.s ~/pr78468.s

Shows nothing, so they are identical

> The 2nd diff still shows the original unaligned STACK_DYNAMIC_OFFSET.

Second is vanilla 8.2, unpatched, which is marked with “-” in diff I posted

Possible problem is that in

-  if (size_align > known_align)
-   size_align = known_align;
+  if (extra && size_align > BITS_PER_UNIT)
+size_align = BITS_PER_UNIT;

you forgot if (extra /* assumed >0 */

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #41 from Wilco  ---
(In reply to Douglas Mencken from comment #40)

> To build it, I patched its sources with fix_gcc8_build.patch reversion
> together with changes from comment #16

So what is the disassembly now? The 2nd diff still shows the original unaligned
STACK_DYNAMIC_OFFSET.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #40 from Douglas Mencken  ---
Yet I got what I wanted ~ the working GCC 8.2

$ /Developer/GCC/8.2p/PowerPC/32bit/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/Developer/GCC/8.2p/PowerPC/32bit/bin/gcc
COLLECT_LTO_WRAPPER=/Developer/GCC/8.2p/PowerPC/32bit/libexec/gcc/powerpc-unknown-darwin/8.2.0/lto-wrapper
Target: powerpc-unknown-darwin
Configured with: ../gcc-8.2.0/configure --build=powerpc-unknown-darwin
--host=powerpc-unknown-darwin --target=powerpc-unknown-darwin
--prefix=/Developer/GCC/8.2p/PowerPC/32bit
--enable-languages=c,c++,objc,obj-c++ --enable-shared --enable-static
--enable-checking=release --enable-threads=posix --with-__thread
--without-system-zlib --disable-nls --disable-werror
Thread model: posix
gcc version 8.2.0 (GCC)

To build it, I patched its sources with fix_gcc8_build.patch reversion together
with changes from comment #16

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #39 from Douglas Mencken  ---
(In reply to Wilco from comment #38)

> You can have data in text sections, including bytes and half words. Even if
> instructions aligned automatically, the function label might be unaligned if
> it was preceded by a byte.

Ah, like in these old days of manual coding in ppc assembly... But when entry
of function is aligned on 2-byte but not 4-byte then code of such function
would not be understood by processor at all. Thus or .align 4, or ditch that
“can have data in text sections” completely

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #38 from Wilco  ---
(In reply to Douglas Mencken from comment #37)
> And some more in my wish list. May GCC don’t generate these
> 
> .align2
> 
> in text section? Any, each and every powerpc instruction is 32bit-wide, no
> and never more, no and never less, so these aligns are redundant

You can have data in text sections, including bytes and half words. Even if
instructions aligned automatically, the function label might be unaligned if it
was preceded by a byte.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #37 from Douglas Mencken  ---
And some more in my wish list. May GCC don’t generate these

.align  2

in text section? Any, each and every powerpc instruction is 32bit-wide, no and
never more, no and never less, so these aligns are redundant

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #36 from Douglas Mencken  ---
(In reply to Iain Sandoe from comment #31)

> * please could you use
> --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9
> --target=powerpc-apple-darwin9 (or leave these off - which will cause it to
> use the current system version).

Does it matter so much? I bet it doesn’t. And host (stage0) compiler I use is
patched 7.3 GCC configured with powerpc-unknown-darwin triplet

> * how about a build --enable-checking=yes[,rtf,tree] ? in case that shows
> something useful?

Yet I’m some kind of being tired of process of building GCC many times, so
maybe.. later

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #35 from Douglas Mencken  ---
(In reply to Wilco from comment #33)

> So functions must preserve 16-byte alignment, but can they rely on the stack
> being always 16-byte aligned on entry?

I bet yes when it’s not some hardcoded-by-hand assembly with its own rules. So
you may be sure that you get r1 with zeroes in last four bits of it on “bl” or
like

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #34 from Douglas Mencken  ---
Created attachment 44903
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44903=edit
8.2vanilla-pr78468.s

And there’s assembly produced by *vanilla* (id est with Wilco’s r251713 causing
the fail in question) 8.2’s stage1 xgcc

--- 8.2vanilla-pr78468.s
+++ 8.2patched-pr78468.s
@@ -70,7 +70,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,18
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -103,7 +103,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,18
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -137,7 +137,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,22
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -170,7 +170,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,22
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -204,7 +204,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,30
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -237,7 +237,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,15
+   addi r3,r3,30
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -271,7 +271,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,31
+   addi r3,r3,46
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)
@@ -305,7 +305,7 @@
mflr r0
stw r30,-8(r1)
stw r0,8(r1)
-   addi r3,r3,31
+   addi r3,r3,46
stw r31,-4(r1)
rlwinm r3,r3,0,0,27
stwu r1,-96(r1)

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #33 from Wilco  ---
(In reply to Iain Sandoe from comment #30)

> From "Mac_OS_X_ABI_Function_Calls.pdf"
> 
> m32 calling convention
> 
> Prologs and Epilogs
> The called function is responsible for allocating its own stack frame,
> making sure to preserve 16-byte alignment in the stack. This operation is
> accomplished by a section of code called the prolog, which the compiler
> places before the body of the subroutine. After the body of the subroutine,
> the compiler places an epilog to restore the processor to the state it was
> prior to the subroutine call.

So functions must preserve 16-byte alignment, but can they rely on the stack
being always 16-byte aligned on entry?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #32 from Wilco  ---
(In reply to Segher Boessenkool from comment #29)
> It aligns the stack to 16:
> 
>   # r3 is size, at entry
>   addi r3,r3,18
>   ...
>   rlwinm r3,r3,0,0,27
>   ...
>   neg r3,r3
>   ...
>   lwz r2,0(r1)
>   ...
>   stwux r2,r1,r3
> 
> (the rlwinm is  r3 &= ~15;  )

So this rounds up the size but also adds an extra 16 bytes to the requested
allocation. The alloca blocks don't get correctly aligned since
STACK_DYNAMIC_OFFSET returns 72 (which is not a multiple of 16):

t1_a4
addi r2,r1,72  -> 72 % 16 != 0 (correct value would be 64)
stw r6,60(r1)
stw r2,56(r1)

This also shows in t1/t2_a32:

addi r2,r1,103  -> 31 + 72 = 103 (correct value would be 80+31)
stw r6,64(r1)
rlwinm r2,r2,0,0,26

So this proves STACK_DYNAMIC_OFFSET is incorrect indeed. If there are still
failures with that fixed then the stack pointer must also be unaligned.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #31 from Iain Sandoe  ---
(In reply to Douglas Mencken from comment #4)
> (In reply to Richard Biener from comment #3)
> > How did you configure?
> 
> As always
> 
> ../gcc-8.1.0/configure \
> --build=powerpc-unknown-darwin --host=powerpc-unknown-darwin
> --target=powerpc-unknown-darwin \
> --prefix=/Developer/GCC/8.1/PowerPC/32bit \
> --enable-languages=c,c++,objc,obj-c++ \
> --enable-shared --enable-static \
> --enable-checking=release \
> --enable-threads=posix --with-__thread --without-system-zlib \
> --disable-nls --disable-werror

* please could you use
--build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9
--target=powerpc-apple-darwin9 (or leave these off - which will cause it to use
the current system version).

Some of the configury will choose values suitable for 10.0+ when there's no
version given, which isn't much tested.

There are also two places that explicitly mention 'apple' (I doubt they are
important here - and I have a patch to remove them, but for now...)

* I'm not sure what --with-__thread is going to do here.

* how about a build --enable-checking=yes[,rtf,tree] ? in case that shows
something useful?

hopefully, will find time to boot a system over the weekend.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #30 from Iain Sandoe  ---
(In reply to Segher Boessenkool from comment #27)
> The stack is always 16B-aligned on Darwin as far as I know.  Cc:ing Iain, he
> will know for sure (I cannot find the docs, &^%*&^$#*&%)

I actually thought we'd been around this loop a couple of revs. ago (when there
was a change made to the headers, and it had been confirmed to be OK).

don't have a system booted at the moment .. and haven't (yet) had the details -
but here:

From "Mac_OS_X_ABI_Function_Calls.pdf"

m32 calling convention

Prologs and Epilogs
The called function is responsible for allocating its own stack frame, making
sure to preserve 16-byte alignment in the stack. This operation is accomplished
by a section of code called the prolog, which the compiler places before the
body of the subroutine. After the body of the subroutine, the compiler places
an epilog to restore the processor to the state it was prior to the subroutine
call.

m64 calling convention

Prologs and Epilogs
The called function is responsible for allocating its own stack frame, making
sure to preserve 16-byte alignment in the stack. This operation is accomplished
by a section of code called the prolog, which the compiler places before the
body of the subroutine. After the body of the subroutine, the compiler places
an epilog to restore the processor to the state it was prior to the subroutine
call.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #29 from Segher Boessenkool  ---
It aligns the stack to 16:

# r3 is size, at entry
addi r3,r3,18
...
rlwinm r3,r3,0,0,27
...
neg r3,r3
...
lwz r2,0(r1)
...
stwux r2,r1,r3

(the rlwinm is  r3 &= ~15;  )

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #28 from Douglas Mencken  ---
Created attachment 44902
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44902=edit
8.2patched-pr78468.s

Assembly produced by patched 8.2’s stage1 xgcc compiled using

prev-gcc/xgcc -B/Volumes/LibreOffice/TheGCC/_build_8.2/prev-gcc/ -O2
-fno-inline pr78468.c -save-temps

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Segher Boessenkool  changed:

   What|Removed |Added

 CC||iains at gcc dot gnu.org

--- Comment #27 from Segher Boessenkool  ---
The stack is always 16B-aligned on Darwin as far as I know.  Cc:ing Iain, he
will know for sure (I cannot find the docs, &^%*&^$#*&%)

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #26 from Wilco  ---
(In reply to Douglas Mencken from comment #25)
> (In reply to Wilco from comment #24)
> 
> > Yes the stage1 compiler would be fine or alternatively use
> > --disable-bootstrap to get an installed compiler.
> 
> I’m yet at libstdc++ of stage2 (which means that it succeeded the place of
> failing) for 8.2 patched with the reversion I’ve just published. About four
> hours and I’d get working 8.2

If that's the case then STACK_BOUNDARY is incorrect. So what is the actual
alignment on Darwin, 8-byte alignment? How are Altivec instructions handled
which do require 16-byte alignment?

> Or do you want to look at results with your r251713? Does it matter?

Either would be interesting - it would show what alignment the prologue really
uses and what code it generates for alloca.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #25 from Douglas Mencken  ---
(In reply to Wilco from comment #24)

> Yes the stage1 compiler would be fine or alternatively use
> --disable-bootstrap to get an installed compiler.

I’m yet at libstdc++ of stage2 (which means that it succeeded the place of
failing) for 8.2 patched with the reversion I’ve just published. About four
hours and I’d get working 8.2

Or do you want to look at results with your r251713? Does it matter?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #24 from Wilco  ---
(In reply to Douglas Mencken from comment #22)
> (In reply to Wilco from comment #21)
> 
> > That's odd. The stack pointer is definitely 16-byte aligned in all cases
> > right? 
> 
> As I know, PowerPC has no special “stack pointer”, it is just one of general
> purpose register, conventionally it is r1. Instruction like “stwu r3,-2(r1)”
> which are common for prologues easily bin any alignment.

STACK_BOUNDARY is the minimum stack alignment. The optimizer relies on this
being correct. If the ABI or prologue doesn't guarantee the minimum alignment
then alloca will fail, so it's essential to set STACK_BOUNDARY correctly.

> > Can you check gcc.dg/pr78468.c passes and attach the disassembly
> > please?
> 
> Using which compiler? xgcc from stage1? Is it buildable alone by itself?

Yes the stage1 compiler would be fine or alternatively use --disable-bootstrap
to get an installed compiler.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #23 from Douglas Mencken  ---
Created attachment 44901
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44901=edit
fix_gcc8_build.patch

Reversion of r251713, updated for patching sources of 8.2 release

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #22 from Douglas Mencken  ---
(In reply to Wilco from comment #21)

> That's odd. The stack pointer is definitely 16-byte aligned in all cases
> right? 

As I know, PowerPC has no special “stack pointer”, it is just one of general
purpose register, conventionally it is r1. Instruction like “stwu r3,-2(r1)”
which are common for prologues easily bin any alignment.

> Can you check gcc.dg/pr78468.c passes and attach the disassembly
> please?

Using which compiler? xgcc from stage1? Is it buildable alone by itself?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Wilco  changed:

   What|Removed |Added

 CC||wdijkstr at arm dot com

--- Comment #21 from Wilco  ---
(In reply to Douglas Mencken from comment #18)
> (In reply to Wilco from comment #17)
> 
> > Yes that should work.
> 
> Oops, but it doesn’t. I just tested it with patched 8.2. Same messages, same
> breakage

That's odd. The stack pointer is definitely 16-byte aligned in all cases right?
Can you check gcc.dg/pr78468.c passes and attach the disassembly please?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #20 from Segher Boessenkool  ---
This is

#define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)

and

#define MAX_STACK_ALIGNMENT STACK_BOUNDARY

so that seems normal.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #19 from Douglas Mencken  ---
I dunno are such warnings related or not

echo timestamp > s-gtype
ccache /Developer/GCC/7.3p/PowerPC/32bit/bin/g++ -std=gnu++98 -fno-PIE -c   -g
-mdynamic-no-pic -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -I. -I. -I../../gcc-8.2.0/gcc -I../../gcc-8.2.0/gcc/.
-I../../gcc-8.2.0/gcc/../include -I../../gcc-8.2.0/gcc/../libcpp/include
-I/Volumes/LibreOffice/TheGCC/_build_8.2/./gmp
-I/Volumes/LibreOffice/TheGCC/gcc-8.2.0/gmp
-I/Volumes/LibreOffice/TheGCC/_build_8.2/./mpfr/src
-I/Volumes/LibreOffice/TheGCC/gcc-8.2.0/mpfr/src
-I/Volumes/LibreOffice/TheGCC/gcc-8.2.0/mpc/src 
-I../../gcc-8.2.0/gcc/../libdecnumber -I../../gcc-8.2.0/gcc/../libdecnumber/dpd
-I../libdecnumber -I../../gcc-8.2.0/gcc/../libbacktrace
-I/Volumes/LibreOffice/TheGCC/_build_8.2/./isl/include
-I/Volumes/LibreOffice/TheGCC/gcc-8.2.0/isl/include  -o explow.o -MT explow.o
-MMD -MP -MF ./.deps/explow.TPo ../../gcc-8.2.0/gcc/explow.c
../../gcc-8.2.0/gcc/explow.c: In function 'rtx_def* round_push(rtx)':
../../gcc-8.2.0/gcc/explow.c:989:248: warning: self-comparison always evaluates
to false [-Wtautological-compare]
   if (!SUPPORTS_STACK_ALIGNMENT
 ~~~
 ^
../../gcc-8.2.0/gcc/explow.c: In function 'void emit_stack_restore(save_level,
rtx)':
../../gcc-8.2.0/gcc/explow.c:1104:247: warning: self-comparison always
evaluates to false [-Wtautological-compare]
   if (SUPPORTS_STACK_ALIGNMENT)

^
rm -rf libbackend.a

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #18 from Douglas Mencken  ---
(In reply to Wilco from comment #17)

> Yes that should work.

Oops, but it doesn’t. I just tested it with patched 8.2. Same messages, same
breakage

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #17 from Wilco  ---
(In reply to Douglas Mencken from comment #16)
> Like this?
> 
> --- a/gcc/config/rs6000/darwin.h
> +++ b/gcc/config/rs6000/darwin.h
> @@ -150,13 +150,12 @@
>  
>  #undef RS6000_STARTING_FRAME_OFFSET
>  #define RS6000_STARTING_FRAME_OFFSET \
> -  (RS6000_ALIGN (crtl->outgoing_args_size, 16)   
> \
> -   + RS6000_SAVE_AREA)
> +  RS6000_ALIGN (crtl->outgoing_args_size + RS6000_SAVE_AREA, 16)
>  
>  #undef STACK_DYNAMIC_OFFSET
>  #define STACK_DYNAMIC_OFFSET(FUNDECL)
> \
> -  (RS6000_ALIGN (crtl->outgoing_args_size.to_constant (), 16)
> \
> -   + (STACK_POINTER_OFFSET))
> +  RS6000_ALIGN (crtl->outgoing_args_size.to_constant()   
> \
> + + STACK_POINTER_OFFSET, 16)
>  
>  /* Darwin uses a function call if everything needs to be saved/restored.  */

Yes that should work.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #16 from Douglas Mencken  ---
Like this?

--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -150,13 +150,12 @@

 #undef RS6000_STARTING_FRAME_OFFSET
 #define RS6000_STARTING_FRAME_OFFSET   \
-  (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
-   + RS6000_SAVE_AREA)
+  RS6000_ALIGN (crtl->outgoing_args_size + RS6000_SAVE_AREA, 16)

 #undef STACK_DYNAMIC_OFFSET
 #define STACK_DYNAMIC_OFFSET(FUNDECL)  \
-  (RS6000_ALIGN (crtl->outgoing_args_size.to_constant (), 16)  \
-   + (STACK_POINTER_OFFSET))
+  RS6000_ALIGN (crtl->outgoing_args_size.to_constant() \
+ + STACK_POINTER_OFFSET, 16)

 /* Darwin uses a function call if everything needs to be saved/restored.  */

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #15 from Wilco  ---
> This will correctly align the outgoing arguments to fails to align the
> outgoing arguments. The STACK_DYNAMIC_OFFSET definitions in rs6000.h and
> aix.h are correct.

Note RS6000_STARTING_FRAME_OFFSET also needs to be updated, again the
definition in aix.h is correct.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #14 from Wilco  ---
Since DEFAULT_ABI == ABI_DARWIN, the save area is 24 bytes:

#define RS6000_SAVE_AREA \
  ((DEFAULT_ABI == ABI_V4 ? 8 : DEFAULT_ABI == ABI_ELFv2 ? 16 : 24) \
   << (TARGET_64BIT ? 1 : 0))

STACK_BOUNDARY is 128 bit (due to TARGET_ALTIVEC_ABI == 1 on darwin):

#define STACK_BOUNDARY  \
  ((TARGET_32BIT && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI && !TARGET_VSX) \
? 64 : 128)

So here is the bug in darwin.h:

#undef STACK_DYNAMIC_OFFSET
#define STACK_DYNAMIC_OFFSET(FUNDECL)   \
  (RS6000_ALIGN (crtl->outgoing_args_size.to_constant (), 16)   \
   + (STACK_POINTER_OFFSET))

This will correctly align the outgoing arguments to fails to align the outgoing
arguments. The STACK_DYNAMIC_OFFSET definitions in rs6000.h and aix.h are
correct.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #13 from Douglas Mencken  ---
Current repo which HEAD is

commit b75be89021ca1da066f892d9a26329009432654c
Author: meissner 
Date:   Wed Oct 24 20:16:31 2018 +

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265471
138bc75d-0d04-0410-961f-82ee72b054a4
r265471 https://gcc.gnu.org/viewcvs/gcc?view=revision=265471

fails the same way

build/gencfn-macros.o build/errors.o build/hash-table.o build/vec.o
build/ggc-none.o build/sort.o
../../host-powerpc-unknown-darwin/libiberty/libiberty.a
build/gencfn-macros -c \
  > tmp-case-cfn-macros.h
build/gencfn-macros: DEF_INTERNAL_FLT_FN (ACOS) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (ASIN) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (ATAN) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (COS) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (EXP) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (EXP10) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (EXP2) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (EXPM1) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LOG) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LOG10) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LOG1P) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LOG2) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LOGB) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (SIN) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (SQRT) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (TAN) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (CEIL) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (FLOOR) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (RINT) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (ROUND) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (TRUNC) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (ATAN2) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (FMOD) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (POW) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (SCALB) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (FMIN) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (FMAX) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (LDEXP) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_FLT_FN (FMA) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (CLRSB) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (CLZ) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (CTZ) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (FFS) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (PARITY) has no associated built-in
functions
make[3]: *** [s-case-cfn-macros] Error 1
make[2]: *** [all-stage2-gcc] Error 2
make[1]: *** [stage2-bubble] Error 2
make: *** [all] Error 2

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-25 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #12 from Douglas Mencken  ---
I finished it

git bisect start
git bisect good gcc-7_3_0-release # r257041
git bisect bad gcc-8_1_0-release # r259829
git bisect good 7369309777f6d6e630fb7763bcd08a0317727e36 # r247015 merge parent
git bisect bad b50e3690fbcafedefdb888c2d66725b8f405706e # r253946
git bisect skip 61cb18166c6a1507af78ce73a4e3c8a21b0cb8ab # r250239
git bisect good 4f5b1ee8ccfd04b939e07bd99f4ca6f8d3f5aa83 # r249172
git bisect good a5079b7fe2c7b4c862704149db5fb0948a7d02f8 # r251339
git bisect bad 237c1ea8f68a7cc3100b63ee50da05c9e0b0ea6d # r253033
git bisect bad 1f0c90bb95ae0d59c93a97dc12294425831c5080 # r251838
git bisect good bc3e9c9df58c165b0157aabf69b222130c835a63 # r251559
git bisect bad 1694a564a16d2403ba1d80778eaacd49b1a62b2c # r251723
git bisect good 9e9e5c15ab8377f3fedc0dd571a0e29810c8c349 # r251637
git bisect good 0d58671cf9b85d18b3a4d2ec785dd95b6bd604db # r251681
git bisect good 404455fef970eea7f65545ed7ed87501ef925718 # r251700
git bisect good 3daf52f78423515253c156cf5adc94d5e6b00994 # r251711
git bisect bad b0e3c082a4b51073d516d7e308e3720c482019ef # r251717
git bisect bad d29e4e8c5dad17dc1f22c5acf950b13820c7876f # r251714
git bisect bad ef6533727511b05fd7e4c7325bf822f4fc1ae4d8 # r251713

first bad commit: [ef6533727511b05fd7e4c7325bf822f4fc1ae4d8] Improve alloca
alignment

ef6533727511b05fd7e4c7325bf822f4fc1ae4d8 is the first bad commit
commit ef6533727511b05fd7e4c7325bf822f4fc1ae4d8
Author: wilco 

https://gcc.gnu.org/viewcvs/gcc?view=revision=251713

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-24 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #11 from Douglas Mencken  ---
I’m bisecting yet

CC="ccache /Developer/GCC/7.3p/PowerPC/32bit/bin/gcc" \
CXX="ccache /Developer/GCC/7.3p/PowerPC/32bit/bin/g++" \
../gcc-build/configure \
--build=powerpc-unknown-darwin --host=powerpc-unknown-darwin
--target=powerpc-unknown-darwin \
--prefix=/Developer/GCC/7_to_8_bisecting/PowerPC/32bit \
--enable-languages=c,c++,objc,obj-c++ \
--enable-shared --enable-static \
--enable-checking=release \
--enable-threads=posix --with-__thread --without-system-zlib \
--disable-nls --disable-werror

make -j3 2>&1 | tee ../_7_to_8_bootstrap.log

iain.patch is needed for 7.3 before r257501 patch
https://gcc.gnu.org/viewcvs/gcc?view=revision=257501
that is git commit 566f381623050c5af7ba9d02d05a5b9b1c046158
you may get it from https://ftp.osuosl.org/pub/manulix/other/GCC/iain.patch

$ git bisect start
$ git bisect good gcc-7_3_0-release # "good" as in it reaches stage3, patched
with iain.patch if it needs to
$ git bisect bad gcc-8_1_0-release # otherwise it’s "bad"
Bisecting: a merge base must be tested
[7369309777f6d6e630fb7763bcd08a0317727e36] [ARM] Fix type for .init_array.* and
.fini_array.* sections
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
$ cat stage_current
stage3
$ git stash
$ git bisect good # 7369309777f6d6e630fb7763bcd08a0317727e36 # r247015
Bisecting: 4002 revisions left to test after this (roughly 12 steps)
[b50e3690fbcafedefdb888c2d66725b8f405706e] Add ChangeLog entries, missing from
last commit
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
build/gencfn-macros: DEF_INTERNAL_INT_FN (PARITY) has no associated built-in
functions
make[3]: *** [s-case-cfn-macros] Error 1
$ cat stage_current
stage2
$ git stash
$ git bisect bad # b50e3690fbcafedefdb888c2d66725b8f405706e # r253946
Bisecting: 2001 revisions left to test after this (roughly 11 steps)
[61cb18166c6a1507af78ce73a4e3c8a21b0cb8ab]  * profile-count.h
(profile_probability::from_reg_br_prob_note, 
profile_probability::to_reg_br_prob_note): New functions.
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
Undefined symbols:
  "make_pass_analyze_swaps(gcc::context*)", referenced from:
  gcc::pass_manager::pass_manager(gcc::context*) in libbackend.a(passes.o)
  gcc::pass_manager::pass_manager(gcc::context*) in libbackend.a(passes.o)
  "rs6000_output_load_multiple(rtx_def**)", referenced from:
  output_464(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  output_465(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  output_466(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  output_467(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  output_468(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  output_469(rtx_def**, rtx_insn*) in libbackend.a(insn-output.o)
  "expand_block_move(rtx_def**)", referenced from:
  gen_movmemsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*) in
libbackend.a(insn-emit.o)
  "expand_block_clear(rtx_def**)", referenced from:
  gen_setmemsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*) in
libbackend.a(insn-emit.o)
ld: symbol(s) not found
make[3]: *** [cc1plus] Error 1
$ cat stage_current
stage1
$ git stash
$ git bisect skip # 61cb18166c6a1507af78ce73a4e3c8a21b0cb8ab # r250239
Bisecting: 2001 revisions left to test after this (roughly 11 steps)
[4f5b1ee8ccfd04b939e07bd99f4ca6f8d3f5aa83]  PR go/80964 * configure.ac:
Set NATIVE if host_alias = target_alias.* configure: Rebuild.
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
$ cat stage_current
stage3
$ git stash
$ git bisect good # 4f5b1ee8ccfd04b939e07bd99f4ca6f8d3f5aa83 # r249172
Bisecting: 1338 revisions left to test after this (roughly 10 steps)
[a5079b7fe2c7b4c862704149db5fb0948a7d02f8] Adds the powerpc equivalent
mm_malloc.h header which is needed by xmmintrin.h and cleans up some noisy
warnings from the previous MMX commit.
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
$ cat stage_current
stage3
$ git stash
$ git bisect good # a5079b7fe2c7b4c862704149db5fb0948a7d02f8 # r251339
Bisecting: 668 revisions left to test after this (roughly 9 steps)
[237c1ea8f68a7cc3100b63ee50da05c9e0b0ea6d] rs6000: Don't touch below the stack
pointer (PR77687)
$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
build/gencfn-macros: DEF_INTERNAL_INT_FN (FFS) has no associated built-in
functions
build/gencfn-macros: DEF_INTERNAL_INT_FN (PARITY) has no associated built-in
functions
make[3]: *** [s-case-cfn-macros] Error 1
$ cat stage_current
stage2
$ git stash
$ git bisect bad # 237c1ea8f68a7cc3100b63ee50da05c9e0b0ea6d # r253033
Bisecting: 334 revisions left to test after this (roughly 8 steps)
[1f0c90bb95ae0d59c93a97dc12294425831c5080] 2017-09-07  Nicolas Roche 

$ patch -p1 < ../patches/iain.patch
$ ... configure and make ...
build/gencfn-macros: DEF_INTERNAL_INT_FN (CTZ) has no associated built-in

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-23 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #10 from Segher Boessenkool  ---
Thanks Douglas, no that is fine of course :-)  What I wanted to know is, does
it fail for the newest versions as well.  So it appears it does.  Which Ryan
already said but I have trouble reading apparently :-/

Thanks for the report!

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-23 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #9 from Douglas Mencken  ---
(In reply to Segher Boessenkool from comment #8)
> Is this on all (PowerPC) Darwin?  Only one some versions?  Which, then?

I am really not going to check it on OS X 10.0 or OS X Beta, or even OS X 10.2.
It fails on OS X 10.5 and OS X 10.4. It fails when it’s built via GCCs bundled
with Xcode, 4.0.1 and 4.2.1, as well as with self-built GCCs like 7.3.0 patched
and 6.4.0. It fails on stage2, in words: stage TWO, and stage1 ( stage ONE,
that one which depends on stage0, id est system, compiler ) is okay

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-10-23 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #8 from Segher Boessenkool  ---
Is this on all (PowerPC) Darwin?  Only one some versions?  Which, then?

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-07-30 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-07-30
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #7 from Eric Gallager  ---
(In reply to Ryan Schmidt from comment #6)
> I can confirm the "DEF_INTERNAL_FLT_FN (...) has no associated built-in
> functions" errors when building gcc 8.2.0 with Apple gcc 4.2.1 from Xcode
> 3.1.4 on PowerPC Mac OS X 10.5.8.

ok, changing status to NEW then

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-07-30 Thread gcc at ryandesign dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Ryan Schmidt  changed:

   What|Removed |Added

 CC||gcc at ryandesign dot com

--- Comment #6 from Ryan Schmidt  ---
I can confirm the "DEF_INTERNAL_FLT_FN (...) has no associated built-in
functions" errors when building gcc 8.2.0 with Apple gcc 4.2.1 from Xcode 3.1.4
on PowerPC Mac OS X 10.5.8.

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-06-13 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #5 from Douglas Mencken  ---
Bisecting is hard, because commits before
15adae8bbeb4579910eadf636e3b06f3dae4a342 “ PR bootstrap/82939
* line-map.c (linemap_init): Avoid broken value-init when compiling with GCC
4.2 ”
segfault on genmatch

echo timestamp > s-conditions
ccache /Developer/usr/bin/g++-4.2 -std=gnu++98 -c   -g -mdynamic-no-pic
-DIN_GCC-fno-strict-aliasing -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wno-format
-Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE
-fno-PIE -I. -Ibuild -I../../gcc-git/gcc -I../../gcc-git/gcc/build
-I../../gcc-git/gcc/../include  -I../../gcc-git/gcc/../libcpp/include  \
-o build/gencondmd.o build/gencondmd.c
/bin/sh: line 1: 23267 Segmentation fault  build/genmatch --gimple
../../gcc-git/gcc/match.pd > tmp-gimple-match.c
make[3]: *** [s-match] Error 139
make[3]: *** Waiting for unfinished jobs
rm fsf-funding.pod gcov.pod gfdl.pod gpl.pod cpp.pod gcc.pod gcov-dump.pod
gcov-tool.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-05-08 Thread dougmencken at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

--- Comment #4 from Douglas Mencken  ---
(In reply to Richard Biener from comment #3)
> How did you configure?

As always

../gcc-8.1.0/configure \
--build=powerpc-unknown-darwin --host=powerpc-unknown-darwin
--target=powerpc-unknown-darwin \
--prefix=/Developer/GCC/8.1/PowerPC/32bit \
--enable-languages=c,c++,objc,obj-c++ \
--enable-shared --enable-static \
--enable-checking=release \
--enable-threads=posix --with-__thread --without-system-zlib \
--disable-nls --disable-werror

[Bug target/85669] fail on s-case-cfn-macros: build/gencfn-macros: DEF_INTERNAL_FLT/INT_FN (%smth%) has no associated built-in functions

2018-05-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85669

Richard Biener  changed:

   What|Removed |Added

   Keywords||build
  Component|regression  |target

--- Comment #3 from Richard Biener  ---
How did you configure?