* [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
@ 2021-05-23 9:41 apinski
2021-05-25 14:22 ` Richard Biener
0 siblings, 1 reply; 16+ messages in thread
From: apinski @ 2021-05-23 9:41 UTC (permalink / raw)
To: gcc-patches; +Cc: Andrew Pinski
From: Andrew Pinski <apinski@marvell.com>
Instead of some of the more manual optimizations inside phi-opt,
it would be good idea to do a lot of the heavy lifting inside match
and simplify instead. In the process, this moves the three simple
A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
Differences from V1:
* Use bit_xor 1 instead of bit_not to fix the problem with boolean types
which are not 1 bit precision.
Thanks,
Andrew Pinski
gcc:
* match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
A?POW2:0 and A?0:POW2.
---
gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/gcc/match.pd b/gcc/match.pd
index 1fc6b7b1557..ad6b057c56d 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(if (integer_all_onesp (@1) && integer_zerop (@2))
@0))))
+/* A few simplifications of "a ? CST1 : CST2". */
+/* NOTE: Only do this on gimple as the if-chain-to-switch
+ optimization depends on the gimple to have if statements in it. */
+#if GIMPLE
+(simplify
+ (cond @0 INTEGER_CST@1 INTEGER_CST@2)
+ (switch
+ (if (integer_zerop (@2))
+ (switch
+ /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
+ (if (integer_onep (@1))
+ (convert (convert:boolean_type_node @0)))
+ /* a ? -1 : 0 -> -a. */
+ (if (integer_all_onesp (@1))
+ (negate (convert (convert:boolean_type_node @0))))
+ /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
+ (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
+ (with {
+ tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
+ }
+ (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
+ (if (integer_zerop (@1))
+ (with {
+ tree booltrue = constant_boolean_node (true, boolean_type_node);
+ }
+ (switch
+ /* a ? 0 : 1 -> !a. */
+ (if (integer_onep (@2))
+ (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
+ /* a ? -1 : 0 -> -(!a). */
+ (if (integer_all_onesp (@2))
+ (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
+ /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
+ (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
+ (with {
+ tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
+ }
+ (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
+ { shift; }))))))))
+#endif
+
/* Simplification moved from fold_cond_expr_with_comparison. It may also
be extended. */
/* This pattern implements two kinds simplification:
--
2.17.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-23 9:41 [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations apinski
@ 2021-05-25 14:22 ` Richard Biener
2021-05-26 8:28 ` Bernd Edlinger
0 siblings, 1 reply; 16+ messages in thread
From: Richard Biener @ 2021-05-25 14:22 UTC (permalink / raw)
To: apinski; +Cc: GCC Patches
On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Instead of some of the more manual optimizations inside phi-opt,
> it would be good idea to do a lot of the heavy lifting inside match
> and simplify instead. In the process, this moves the three simple
> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>
> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>
> Differences from V1:
> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> which are not 1 bit precision.
OK.
Thanks,
Richard.
> Thanks,
> Andrew Pinski
>
> gcc:
> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> A?POW2:0 and A?0:POW2.
> ---
> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/gcc/match.pd b/gcc/match.pd
> index 1fc6b7b1557..ad6b057c56d 100644
> --- a/gcc/match.pd
> +++ b/gcc/match.pd
> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> (if (integer_all_onesp (@1) && integer_zerop (@2))
> @0))))
>
> +/* A few simplifications of "a ? CST1 : CST2". */
> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> + optimization depends on the gimple to have if statements in it. */
> +#if GIMPLE
> +(simplify
> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> + (switch
> + (if (integer_zerop (@2))
> + (switch
> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> + (if (integer_onep (@1))
> + (convert (convert:boolean_type_node @0)))
> + /* a ? -1 : 0 -> -a. */
> + (if (integer_all_onesp (@1))
> + (negate (convert (convert:boolean_type_node @0))))
> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> + (with {
> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> + }
> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> + (if (integer_zerop (@1))
> + (with {
> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> + }
> + (switch
> + /* a ? 0 : 1 -> !a. */
> + (if (integer_onep (@2))
> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> + /* a ? -1 : 0 -> -(!a). */
> + (if (integer_all_onesp (@2))
> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> + (with {
> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> + }
> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> + { shift; }))))))))
> +#endif
> +
> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> be extended. */
> /* This pattern implements two kinds simplification:
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-25 14:22 ` Richard Biener
@ 2021-05-26 8:28 ` Bernd Edlinger
2021-05-26 9:01 ` Andrew Pinski
0 siblings, 1 reply; 16+ messages in thread
From: Bernd Edlinger @ 2021-05-26 8:28 UTC (permalink / raw)
To: Richard Biener, apinski; +Cc: GCC Patches
On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> From: Andrew Pinski <apinski@marvell.com>
>>
>> Instead of some of the more manual optimizations inside phi-opt,
>> it would be good idea to do a lot of the heavy lifting inside match
>> and simplify instead. In the process, this moves the three simple
>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>
>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>
>> Differences from V1:
>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>> which are not 1 bit precision.
>
> OK.
>
> Thanks,
> Richard.
>
Hmm, sorry, no luck.
I think this caused:
home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
during GIMPLE pass: evrp
../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
155 | }
| ^
0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
../../gcc-trunk/gcc/vec.h:890
0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
../../gcc-trunk/gcc/tree.h:3366
0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
../../gcc-trunk/gcc/vec.h:1461
0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
../../gcc-trunk/gcc/gimple-range-gori.cc:179
0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
../../gcc-trunk/gcc/gimple-range.cc:439
0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:376
0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:1067
0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:1097
0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
../../gcc-trunk/gcc/gimple-range.cc:980
0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
../../gcc-trunk/gcc/gimple-range.cc:431
0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:376
0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:1067
0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:1097
0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
../../gcc-trunk/gcc/gimple-range.cc:980
0x1149961 range_query::value_of_expr(tree_node*, gimple*)
../../gcc-trunk/gcc/value-query.cc:86
0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
../../gcc-trunk/gcc/tree-ssa-propagate.c:575
0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
../../gcc-trunk/gcc/tree-ssa-propagate.c:845
0x183921f dom_walker::walk(basic_block_def*)
../../gcc-trunk/gcc/domwalk.c:309
0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
../../gcc-trunk/gcc/tree-ssa-propagate.c:987
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [Makefile:76: fixtests.o] Error 1
make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
make[1]: *** [Makefile:3827: all-fixincludes] Error 2
make[1]: Leaving directory '/home/ed/gnu/gcc-build'
make: *** [Makefile:1011: all] Error 2
Bernd.
>> Thanks,
>> Andrew Pinski
>>
>> gcc:
>> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
>> A?POW2:0 and A?0:POW2.
>> ---
>> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 41 insertions(+)
>>
>> diff --git a/gcc/match.pd b/gcc/match.pd
>> index 1fc6b7b1557..ad6b057c56d 100644
>> --- a/gcc/match.pd
>> +++ b/gcc/match.pd
>> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>> (if (integer_all_onesp (@1) && integer_zerop (@2))
>> @0))))
>>
>> +/* A few simplifications of "a ? CST1 : CST2". */
>> +/* NOTE: Only do this on gimple as the if-chain-to-switch
>> + optimization depends on the gimple to have if statements in it. */
>> +#if GIMPLE
>> +(simplify
>> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
>> + (switch
>> + (if (integer_zerop (@2))
>> + (switch
>> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
>> + (if (integer_onep (@1))
>> + (convert (convert:boolean_type_node @0)))
>> + /* a ? -1 : 0 -> -a. */
>> + (if (integer_all_onesp (@1))
>> + (negate (convert (convert:boolean_type_node @0))))
>> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
>> + (with {
>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
>> + }
>> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
>> + (if (integer_zerop (@1))
>> + (with {
>> + tree booltrue = constant_boolean_node (true, boolean_type_node);
>> + }
>> + (switch
>> + /* a ? 0 : 1 -> !a. */
>> + (if (integer_onep (@2))
>> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
>> + /* a ? -1 : 0 -> -(!a). */
>> + (if (integer_all_onesp (@2))
>> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
>> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
>> + (with {
>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
>> + }
>> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
>> + { shift; }))))))))
>> +#endif
>> +
>> /* Simplification moved from fold_cond_expr_with_comparison. It may also
>> be extended. */
>> /* This pattern implements two kinds simplification:
>> --
>> 2.17.1
>>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 8:28 ` Bernd Edlinger
@ 2021-05-26 9:01 ` Andrew Pinski
2021-05-26 11:07 ` Andrew Pinski
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Pinski @ 2021-05-26 9:01 UTC (permalink / raw)
To: Bernd Edlinger; +Cc: Richard Biener, Andrew Pinski, GCC Patches
On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
>
> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> >>
> >> From: Andrew Pinski <apinski@marvell.com>
> >>
> >> Instead of some of the more manual optimizations inside phi-opt,
> >> it would be good idea to do a lot of the heavy lifting inside match
> >> and simplify instead. In the process, this moves the three simple
> >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> >>
> >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> >>
> >> Differences from V1:
> >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> >> which are not 1 bit precision.
> >
> > OK.
> >
> > Thanks,
> > Richard.
> >
>
> Hmm, sorry, no luck.
>
> I think this caused:
If anything it is a bad interaction with changes between r12-1046 and
r12-1053; I am suspecting a bug in those changes rather than my
changes causing the bug. Debugging it right now.
Thanks,
Andrew
>
> home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
> during GIMPLE pass: evrp
> ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
> ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
> 155 | }
> | ^
> 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
> ../../gcc-trunk/gcc/vec.h:890
> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
> ../../gcc-trunk/gcc/tree.h:3366
> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
> ../../gcc-trunk/gcc/vec.h:1461
> 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
> ../../gcc-trunk/gcc/gimple-range-gori.cc:179
> 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> ../../gcc-trunk/gcc/gimple-range.cc:439
> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:376
> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:1067
> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:1097
> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> ../../gcc-trunk/gcc/gimple-range.cc:980
> 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> ../../gcc-trunk/gcc/gimple-range.cc:431
> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:376
> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:1067
> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> ../../gcc-trunk/gcc/gimple-range.cc:1097
> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> ../../gcc-trunk/gcc/gimple-range.cc:980
> 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
> ../../gcc-trunk/gcc/value-query.cc:86
> 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
> ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
> 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
> ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
> 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
> ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
> 0x183921f dom_walker::walk(basic_block_def*)
> ../../gcc-trunk/gcc/domwalk.c:309
> 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
> ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <https://gcc.gnu.org/bugs/> for instructions.
> make[2]: *** [Makefile:76: fixtests.o] Error 1
> make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
> make[1]: *** [Makefile:3827: all-fixincludes] Error 2
> make[1]: Leaving directory '/home/ed/gnu/gcc-build'
> make: *** [Makefile:1011: all] Error 2
>
>
> Bernd.
>
>
> >> Thanks,
> >> Andrew Pinski
> >>
> >> gcc:
> >> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> >> A?POW2:0 and A?0:POW2.
> >> ---
> >> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> >> 1 file changed, 41 insertions(+)
> >>
> >> diff --git a/gcc/match.pd b/gcc/match.pd
> >> index 1fc6b7b1557..ad6b057c56d 100644
> >> --- a/gcc/match.pd
> >> +++ b/gcc/match.pd
> >> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> >> (if (integer_all_onesp (@1) && integer_zerop (@2))
> >> @0))))
> >>
> >> +/* A few simplifications of "a ? CST1 : CST2". */
> >> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> >> + optimization depends on the gimple to have if statements in it. */
> >> +#if GIMPLE
> >> +(simplify
> >> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> >> + (switch
> >> + (if (integer_zerop (@2))
> >> + (switch
> >> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> >> + (if (integer_onep (@1))
> >> + (convert (convert:boolean_type_node @0)))
> >> + /* a ? -1 : 0 -> -a. */
> >> + (if (integer_all_onesp (@1))
> >> + (negate (convert (convert:boolean_type_node @0))))
> >> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> >> + (with {
> >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> >> + }
> >> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> >> + (if (integer_zerop (@1))
> >> + (with {
> >> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> >> + }
> >> + (switch
> >> + /* a ? 0 : 1 -> !a. */
> >> + (if (integer_onep (@2))
> >> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> >> + /* a ? -1 : 0 -> -(!a). */
> >> + (if (integer_all_onesp (@2))
> >> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> >> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> >> + (with {
> >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> >> + }
> >> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> >> + { shift; }))))))))
> >> +#endif
> >> +
> >> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> >> be extended. */
> >> /* This pattern implements two kinds simplification:
> >> --
> >> 2.17.1
> >>
> >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 9:01 ` Andrew Pinski
@ 2021-05-26 11:07 ` Andrew Pinski
2021-05-26 11:27 ` Richard Biener
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Andrew Pinski @ 2021-05-26 11:07 UTC (permalink / raw)
To: Bernd Edlinger, Andrew MacLeod; +Cc: Richard Biener, Andrew Pinski, GCC Patches
On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> <bernd.edlinger@hotmail.de> wrote:
> >
> > On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > > <gcc-patches@gcc.gnu.org> wrote:
> > >>
> > >> From: Andrew Pinski <apinski@marvell.com>
> > >>
> > >> Instead of some of the more manual optimizations inside phi-opt,
> > >> it would be good idea to do a lot of the heavy lifting inside match
> > >> and simplify instead. In the process, this moves the three simple
> > >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> > >>
> > >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> > >>
> > >> Differences from V1:
> > >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> > >> which are not 1 bit precision.
> > >
> > > OK.
> > >
> > > Thanks,
> > > Richard.
> > >
> >
> > Hmm, sorry, no luck.
> >
> > I think this caused:
>
> If anything it is a bad interaction with changes between r12-1046 and
> r12-1053; I am suspecting a bug in those changes rather than my
> changes causing the bug. Debugging it right now.
(gdb) p debug_tree(name)
<ssa_name 0x7ffff6a5cd38
type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
size <integer_cst 0x7ffff6b2bdc8 constant 8>
unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1
canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
def_stmt _19 = ~_8;
version:19>
So what is happening is evrp converted:
ct_12 = ct_5 + -1;
Into
ct_12 = ct_5 == 1 ? 0 : 1;
(this was done before my patch)
And then it gets simplified to:
_8 = ct_5 == 1;
_19 = ~_8;
ct_12 = (int) _19;
(after my match.pd patch)
Which is correct, but the range code is not expecting new SSA names to
be added .....
It looks like the issue was introduced with r12-1048 (Add imports and
strengthen the export definition in range_def and gori_map).
I suspect there are other match.pd patterns which would also hit this
issue where a new ssa name is introduced.
I have no idea how to get this fixed because gimple-range-* is new to
me; I tried looking into it but calling has_def_chain/get_def_chain
inside register_dependency seems wrong, maybe Andrew MacLeod can help
here.
This happens even with a stage 1 gcc so it is not miscompiling.
Also sorry for the breakage, I was not expecting it this time around
as I ran bootstrap like three times and I did not expect an
interaction with other parts of the compiler like this.
Thanks,
Andrew Pinski
>
> Thanks,
> Andrew
>
>
>
>
> >
> > home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
> > during GIMPLE pass: evrp
> > ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
> > ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
> > 155 | }
> > | ^
> > 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
> > ../../gcc-trunk/gcc/vec.h:890
> > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
> > ../../gcc-trunk/gcc/tree.h:3366
> > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
> > ../../gcc-trunk/gcc/vec.h:1461
> > 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
> > ../../gcc-trunk/gcc/gimple-range-gori.cc:179
> > 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > ../../gcc-trunk/gcc/gimple-range.cc:439
> > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:376
> > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > ../../gcc-trunk/gcc/gimple-range.cc:980
> > 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > ../../gcc-trunk/gcc/gimple-range.cc:431
> > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:376
> > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > ../../gcc-trunk/gcc/gimple-range.cc:980
> > 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
> > ../../gcc-trunk/gcc/value-query.cc:86
> > 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
> > ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
> > 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
> > ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
> > 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
> > ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
> > 0x183921f dom_walker::walk(basic_block_def*)
> > ../../gcc-trunk/gcc/domwalk.c:309
> > 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
> > ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > Please include the complete backtrace with any bug report.
> > See <https://gcc.gnu.org/bugs/> for instructions.
> > make[2]: *** [Makefile:76: fixtests.o] Error 1
> > make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
> > make[1]: *** [Makefile:3827: all-fixincludes] Error 2
> > make[1]: Leaving directory '/home/ed/gnu/gcc-build'
> > make: *** [Makefile:1011: all] Error 2
> >
> >
> > Bernd.
> >
> >
> > >> Thanks,
> > >> Andrew Pinski
> > >>
> > >> gcc:
> > >> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> > >> A?POW2:0 and A?0:POW2.
> > >> ---
> > >> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> > >> 1 file changed, 41 insertions(+)
> > >>
> > >> diff --git a/gcc/match.pd b/gcc/match.pd
> > >> index 1fc6b7b1557..ad6b057c56d 100644
> > >> --- a/gcc/match.pd
> > >> +++ b/gcc/match.pd
> > >> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > >> (if (integer_all_onesp (@1) && integer_zerop (@2))
> > >> @0))))
> > >>
> > >> +/* A few simplifications of "a ? CST1 : CST2". */
> > >> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> > >> + optimization depends on the gimple to have if statements in it. */
> > >> +#if GIMPLE
> > >> +(simplify
> > >> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> > >> + (switch
> > >> + (if (integer_zerop (@2))
> > >> + (switch
> > >> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> > >> + (if (integer_onep (@1))
> > >> + (convert (convert:boolean_type_node @0)))
> > >> + /* a ? -1 : 0 -> -a. */
> > >> + (if (integer_all_onesp (@1))
> > >> + (negate (convert (convert:boolean_type_node @0))))
> > >> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> > >> + (with {
> > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> > >> + }
> > >> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> > >> + (if (integer_zerop (@1))
> > >> + (with {
> > >> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> > >> + }
> > >> + (switch
> > >> + /* a ? 0 : 1 -> !a. */
> > >> + (if (integer_onep (@2))
> > >> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> > >> + /* a ? -1 : 0 -> -(!a). */
> > >> + (if (integer_all_onesp (@2))
> > >> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> > >> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> > >> + (with {
> > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> > >> + }
> > >> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> > >> + { shift; }))))))))
> > >> +#endif
> > >> +
> > >> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> > >> be extended. */
> > >> /* This pattern implements two kinds simplification:
> > >> --
> > >> 2.17.1
> > >>
> > >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 11:07 ` Andrew Pinski
@ 2021-05-26 11:27 ` Richard Biener
2021-05-26 11:37 ` Andrew Pinski
2021-05-26 16:54 ` Aldy Hernandez
2021-05-26 17:29 ` Andrew MacLeod
2 siblings, 1 reply; 16+ messages in thread
From: Richard Biener @ 2021-05-26 11:27 UTC (permalink / raw)
To: Andrew Pinski; +Cc: Bernd Edlinger, Andrew MacLeod, Andrew Pinski, GCC Patches
On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
> >
> > On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> > <bernd.edlinger@hotmail.de> wrote:
> > >
> > > On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > > > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > > > <gcc-patches@gcc.gnu.org> wrote:
> > > >>
> > > >> From: Andrew Pinski <apinski@marvell.com>
> > > >>
> > > >> Instead of some of the more manual optimizations inside phi-opt,
> > > >> it would be good idea to do a lot of the heavy lifting inside match
> > > >> and simplify instead. In the process, this moves the three simple
> > > >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> > > >>
> > > >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> > > >>
> > > >> Differences from V1:
> > > >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> > > >> which are not 1 bit precision.
> > > >
> > > > OK.
> > > >
> > > > Thanks,
> > > > Richard.
> > > >
> > >
> > > Hmm, sorry, no luck.
> > >
> > > I think this caused:
> >
> > If anything it is a bad interaction with changes between r12-1046 and
> > r12-1053; I am suspecting a bug in those changes rather than my
> > changes causing the bug. Debugging it right now.
>
> (gdb) p debug_tree(name)
> <ssa_name 0x7ffff6a5cd38
> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> size <integer_cst 0x7ffff6b2bdc8 constant 8>
> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> align:8 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>
> def_stmt _19 = ~_8;
> version:19>
>
> So what is happening is evrp converted:
> ct_12 = ct_5 + -1;
> Into
> ct_12 = ct_5 == 1 ? 0 : 1;
> (this was done before my patch)
Note this COND_EXPR is supposed to be combined
with its single use in a GIMPLE_COND ...
> And then it gets simplified to:
> _8 = ct_5 == 1;
> _19 = ~_8;
> ct_12 = (int) _19;
> (after my match.pd patch)
which this one then breaks. I suppose instead of replacing
ct_12 adjusting the GIMPLE_COND directly might be
a better approach ... or not folding the generated COND_EXPR.
> Which is correct, but the range code is not expecting new SSA names to
> be added .....
> It looks like the issue was introduced with r12-1048 (Add imports and
> strengthen the export definition in range_def and gori_map).
> I suspect there are other match.pd patterns which would also hit this
> issue where a new ssa name is introduced.
>
> I have no idea how to get this fixed because gimple-range-* is new to
> me; I tried looking into it but calling has_def_chain/get_def_chain
> inside register_dependency seems wrong, maybe Andrew MacLeod can help
> here.
> This happens even with a stage 1 gcc so it is not miscompiling.
>
> Also sorry for the breakage, I was not expecting it this time around
> as I ran bootstrap like three times and I did not expect an
> interaction with other parts of the compiler like this.
>
> Thanks,
> Andrew Pinski
>
>
> >
> > Thanks,
> > Andrew
> >
> >
> >
> >
> > >
> > > home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
> > > during GIMPLE pass: evrp
> > > ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
> > > ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
> > > 155 | }
> > > | ^
> > > 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
> > > ../../gcc-trunk/gcc/vec.h:890
> > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
> > > ../../gcc-trunk/gcc/tree.h:3366
> > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
> > > ../../gcc-trunk/gcc/vec.h:1461
> > > 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
> > > ../../gcc-trunk/gcc/gimple-range-gori.cc:179
> > > 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > ../../gcc-trunk/gcc/gimple-range.cc:439
> > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > ../../gcc-trunk/gcc/gimple-range.cc:431
> > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
> > > ../../gcc-trunk/gcc/value-query.cc:86
> > > 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
> > > ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
> > > 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
> > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
> > > 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
> > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
> > > 0x183921f dom_walker::walk(basic_block_def*)
> > > ../../gcc-trunk/gcc/domwalk.c:309
> > > 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
> > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
> > > Please submit a full bug report,
> > > with preprocessed source if appropriate.
> > > Please include the complete backtrace with any bug report.
> > > See <https://gcc.gnu.org/bugs/> for instructions.
> > > make[2]: *** [Makefile:76: fixtests.o] Error 1
> > > make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
> > > make[1]: *** [Makefile:3827: all-fixincludes] Error 2
> > > make[1]: Leaving directory '/home/ed/gnu/gcc-build'
> > > make: *** [Makefile:1011: all] Error 2
> > >
> > >
> > > Bernd.
> > >
> > >
> > > >> Thanks,
> > > >> Andrew Pinski
> > > >>
> > > >> gcc:
> > > >> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> > > >> A?POW2:0 and A?0:POW2.
> > > >> ---
> > > >> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> > > >> 1 file changed, 41 insertions(+)
> > > >>
> > > >> diff --git a/gcc/match.pd b/gcc/match.pd
> > > >> index 1fc6b7b1557..ad6b057c56d 100644
> > > >> --- a/gcc/match.pd
> > > >> +++ b/gcc/match.pd
> > > >> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > > >> (if (integer_all_onesp (@1) && integer_zerop (@2))
> > > >> @0))))
> > > >>
> > > >> +/* A few simplifications of "a ? CST1 : CST2". */
> > > >> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> > > >> + optimization depends on the gimple to have if statements in it. */
> > > >> +#if GIMPLE
> > > >> +(simplify
> > > >> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> > > >> + (switch
> > > >> + (if (integer_zerop (@2))
> > > >> + (switch
> > > >> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> > > >> + (if (integer_onep (@1))
> > > >> + (convert (convert:boolean_type_node @0)))
> > > >> + /* a ? -1 : 0 -> -a. */
> > > >> + (if (integer_all_onesp (@1))
> > > >> + (negate (convert (convert:boolean_type_node @0))))
> > > >> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> > > >> + (with {
> > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> > > >> + }
> > > >> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> > > >> + (if (integer_zerop (@1))
> > > >> + (with {
> > > >> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> > > >> + }
> > > >> + (switch
> > > >> + /* a ? 0 : 1 -> !a. */
> > > >> + (if (integer_onep (@2))
> > > >> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> > > >> + /* a ? -1 : 0 -> -(!a). */
> > > >> + (if (integer_all_onesp (@2))
> > > >> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> > > >> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> > > >> + (with {
> > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> > > >> + }
> > > >> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> > > >> + { shift; }))))))))
> > > >> +#endif
> > > >> +
> > > >> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> > > >> be extended. */
> > > >> /* This pattern implements two kinds simplification:
> > > >> --
> > > >> 2.17.1
> > > >>
> > > >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 11:27 ` Richard Biener
@ 2021-05-26 11:37 ` Andrew Pinski
2021-05-26 12:05 ` Richard Biener
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Pinski @ 2021-05-26 11:37 UTC (permalink / raw)
To: Richard Biener; +Cc: Bernd Edlinger, Andrew MacLeod, Andrew Pinski, GCC Patches
On Wed, May 26, 2021 at 4:28 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
> >
> > On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
> > >
> > > On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> > > <bernd.edlinger@hotmail.de> wrote:
> > > >
> > > > On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > > > > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > > > > <gcc-patches@gcc.gnu.org> wrote:
> > > > >>
> > > > >> From: Andrew Pinski <apinski@marvell.com>
> > > > >>
> > > > >> Instead of some of the more manual optimizations inside phi-opt,
> > > > >> it would be good idea to do a lot of the heavy lifting inside match
> > > > >> and simplify instead. In the process, this moves the three simple
> > > > >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> > > > >>
> > > > >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> > > > >>
> > > > >> Differences from V1:
> > > > >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> > > > >> which are not 1 bit precision.
> > > > >
> > > > > OK.
> > > > >
> > > > > Thanks,
> > > > > Richard.
> > > > >
> > > >
> > > > Hmm, sorry, no luck.
> > > >
> > > > I think this caused:
> > >
> > > If anything it is a bad interaction with changes between r12-1046 and
> > > r12-1053; I am suspecting a bug in those changes rather than my
> > > changes causing the bug. Debugging it right now.
> >
> > (gdb) p debug_tree(name)
> > <ssa_name 0x7ffff6a5cd38
> > type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> > size <integer_cst 0x7ffff6b2bdc8 constant 8>
> > unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> > align:8 warn_if_not_align:0 symtab:0 alias-set -1
> > canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> > 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
> >
> > def_stmt _19 = ~_8;
> > version:19>
> >
> > So what is happening is evrp converted:
> > ct_12 = ct_5 + -1;
> > Into
> > ct_12 = ct_5 == 1 ? 0 : 1;
> > (this was done before my patch)
>
> Note this COND_EXPR is supposed to be combined
> with its single use in a GIMPLE_COND ...
I Noticed it was not doing it (before my patch) inside evrp either.
>
> > And then it gets simplified to:
> > _8 = ct_5 == 1;
> > _19 = ~_8;
> > ct_12 = (int) _19;
> > (after my match.pd patch)
>
> which this one then breaks. I suppose instead of replacing
> ct_12 adjusting the GIMPLE_COND directly might be
> a better approach ... or not folding the generated COND_EXPR.
I was going to try to see where COND_EXPR is created but it is late
and there seems to be other issues going on too.
For example, the above really should have been converted to:
_19 = ct_5 != 1;
ct_12 = (int) _19;
This might be a gimple-match issue where the conditional part is
always emitted without being simplified with the ~ part; COND_EXPR has
those kind of issues :).
Thanks,
Andrew Pinski
>
> > Which is correct, but the range code is not expecting new SSA names to
> > be added .....
> > It looks like the issue was introduced with r12-1048 (Add imports and
> > strengthen the export definition in range_def and gori_map).
> > I suspect there are other match.pd patterns which would also hit this
> > issue where a new ssa name is introduced.
> >
> > I have no idea how to get this fixed because gimple-range-* is new to
> > me; I tried looking into it but calling has_def_chain/get_def_chain
> > inside register_dependency seems wrong, maybe Andrew MacLeod can help
> > here.
> > This happens even with a stage 1 gcc so it is not miscompiling.
> >
> > Also sorry for the breakage, I was not expecting it this time around
> > as I ran bootstrap like three times and I did not expect an
> > interaction with other parts of the compiler like this.
> >
> > Thanks,
> > Andrew Pinski
> >
> >
> > >
> > > Thanks,
> > > Andrew
> > >
> > >
> > >
> > >
> > > >
> > > > home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
> > > > during GIMPLE pass: evrp
> > > > ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
> > > > ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
> > > > 155 | }
> > > > | ^
> > > > 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
> > > > ../../gcc-trunk/gcc/vec.h:890
> > > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
> > > > ../../gcc-trunk/gcc/tree.h:3366
> > > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
> > > > ../../gcc-trunk/gcc/vec.h:1461
> > > > 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
> > > > ../../gcc-trunk/gcc/gimple-range-gori.cc:179
> > > > 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:439
> > > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > > 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:431
> > > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > > 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
> > > > ../../gcc-trunk/gcc/value-query.cc:86
> > > > 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
> > > > ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
> > > > 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
> > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
> > > > 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
> > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
> > > > 0x183921f dom_walker::walk(basic_block_def*)
> > > > ../../gcc-trunk/gcc/domwalk.c:309
> > > > 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
> > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
> > > > Please submit a full bug report,
> > > > with preprocessed source if appropriate.
> > > > Please include the complete backtrace with any bug report.
> > > > See <https://gcc.gnu.org/bugs/> for instructions.
> > > > make[2]: *** [Makefile:76: fixtests.o] Error 1
> > > > make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
> > > > make[1]: *** [Makefile:3827: all-fixincludes] Error 2
> > > > make[1]: Leaving directory '/home/ed/gnu/gcc-build'
> > > > make: *** [Makefile:1011: all] Error 2
> > > >
> > > >
> > > > Bernd.
> > > >
> > > >
> > > > >> Thanks,
> > > > >> Andrew Pinski
> > > > >>
> > > > >> gcc:
> > > > >> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> > > > >> A?POW2:0 and A?0:POW2.
> > > > >> ---
> > > > >> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> > > > >> 1 file changed, 41 insertions(+)
> > > > >>
> > > > >> diff --git a/gcc/match.pd b/gcc/match.pd
> > > > >> index 1fc6b7b1557..ad6b057c56d 100644
> > > > >> --- a/gcc/match.pd
> > > > >> +++ b/gcc/match.pd
> > > > >> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > > > >> (if (integer_all_onesp (@1) && integer_zerop (@2))
> > > > >> @0))))
> > > > >>
> > > > >> +/* A few simplifications of "a ? CST1 : CST2". */
> > > > >> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> > > > >> + optimization depends on the gimple to have if statements in it. */
> > > > >> +#if GIMPLE
> > > > >> +(simplify
> > > > >> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> > > > >> + (switch
> > > > >> + (if (integer_zerop (@2))
> > > > >> + (switch
> > > > >> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> > > > >> + (if (integer_onep (@1))
> > > > >> + (convert (convert:boolean_type_node @0)))
> > > > >> + /* a ? -1 : 0 -> -a. */
> > > > >> + (if (integer_all_onesp (@1))
> > > > >> + (negate (convert (convert:boolean_type_node @0))))
> > > > >> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> > > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> > > > >> + (with {
> > > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> > > > >> + }
> > > > >> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> > > > >> + (if (integer_zerop (@1))
> > > > >> + (with {
> > > > >> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> > > > >> + }
> > > > >> + (switch
> > > > >> + /* a ? 0 : 1 -> !a. */
> > > > >> + (if (integer_onep (@2))
> > > > >> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> > > > >> + /* a ? -1 : 0 -> -(!a). */
> > > > >> + (if (integer_all_onesp (@2))
> > > > >> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> > > > >> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> > > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> > > > >> + (with {
> > > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> > > > >> + }
> > > > >> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> > > > >> + { shift; }))))))))
> > > > >> +#endif
> > > > >> +
> > > > >> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> > > > >> be extended. */
> > > > >> /* This pattern implements two kinds simplification:
> > > > >> --
> > > > >> 2.17.1
> > > > >>
> > > > >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 11:37 ` Andrew Pinski
@ 2021-05-26 12:05 ` Richard Biener
2021-05-26 16:59 ` Andrew MacLeod
2021-05-26 17:03 ` Bernd Edlinger
0 siblings, 2 replies; 16+ messages in thread
From: Richard Biener @ 2021-05-26 12:05 UTC (permalink / raw)
To: Andrew Pinski; +Cc: Bernd Edlinger, Andrew MacLeod, Andrew Pinski, GCC Patches
On Wed, May 26, 2021 at 1:37 PM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Wed, May 26, 2021 at 4:28 AM Richard Biener
> <richard.guenther@gmail.com> wrote:
> >
> > On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
> > >
> > > On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
> > > >
> > > > On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> > > > <bernd.edlinger@hotmail.de> wrote:
> > > > >
> > > > > On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > > > > > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > > > > > <gcc-patches@gcc.gnu.org> wrote:
> > > > > >>
> > > > > >> From: Andrew Pinski <apinski@marvell.com>
> > > > > >>
> > > > > >> Instead of some of the more manual optimizations inside phi-opt,
> > > > > >> it would be good idea to do a lot of the heavy lifting inside match
> > > > > >> and simplify instead. In the process, this moves the three simple
> > > > > >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> > > > > >>
> > > > > >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> > > > > >>
> > > > > >> Differences from V1:
> > > > > >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> > > > > >> which are not 1 bit precision.
> > > > > >
> > > > > > OK.
> > > > > >
> > > > > > Thanks,
> > > > > > Richard.
> > > > > >
> > > > >
> > > > > Hmm, sorry, no luck.
> > > > >
> > > > > I think this caused:
> > > >
> > > > If anything it is a bad interaction with changes between r12-1046 and
> > > > r12-1053; I am suspecting a bug in those changes rather than my
> > > > changes causing the bug. Debugging it right now.
> > >
> > > (gdb) p debug_tree(name)
> > > <ssa_name 0x7ffff6a5cd38
> > > type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> > > size <integer_cst 0x7ffff6b2bdc8 constant 8>
> > > unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> > > align:8 warn_if_not_align:0 symtab:0 alias-set -1
> > > canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> > > 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
> > >
> > > def_stmt _19 = ~_8;
> > > version:19>
> > >
> > > So what is happening is evrp converted:
> > > ct_12 = ct_5 + -1;
> > > Into
> > > ct_12 = ct_5 == 1 ? 0 : 1;
> > > (this was done before my patch)
> >
> > Note this COND_EXPR is supposed to be combined
> > with its single use in a GIMPLE_COND ...
>
> I Noticed it was not doing it (before my patch) inside evrp either.
I think it is at most done in forwprop, but even then it likely
lacks a fold pattern - we only seem to forward comparisons
into GIMPLE_CONDs explicitely, leaving the rest to
match.pd patterns.
> >
> > > And then it gets simplified to:
> > > _8 = ct_5 == 1;
> > > _19 = ~_8;
> > > ct_12 = (int) _19;
> > > (after my match.pd patch)
> >
> > which this one then breaks. I suppose instead of replacing
> > ct_12 adjusting the GIMPLE_COND directly might be
> > a better approach ... or not folding the generated COND_EXPR.
>
> I was going to try to see where COND_EXPR is created but it is late
> and there seems to be other issues going on too.
> For example, the above really should have been converted to:
> _19 = ct_5 != 1;
> ct_12 = (int) _19;
>
> This might be a gimple-match issue where the conditional part is
> always emitted without being simplified with the ~ part; COND_EXPR has
> those kind of issues :).
No, we always re-simplify things, but there might be no
(bit_not (eq @0 integer_onep)) simplifier.
Oddly enough
_Bool foo (int x)
{
_Bool tem = x == 1;
return ~tem;
}
is simplified to return 1 via matching
/* Fold ~X op C as X op' ~C, where op' is the swapped comparison. */
(for cmp (simple_comparison)
scmp (swapped_simple_comparison)
(simplify
(cmp (bit_not@2 @0) CONSTANT_CLASS_P@1)
(if (single_use (@2)
&& (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST))
(scmp @0 (bit_not @1)))))
Richard.
> Thanks,
> Andrew Pinski
>
>
> >
> > > Which is correct, but the range code is not expecting new SSA names to
> > > be added .....
> > > It looks like the issue was introduced with r12-1048 (Add imports and
> > > strengthen the export definition in range_def and gori_map).
> > > I suspect there are other match.pd patterns which would also hit this
> > > issue where a new ssa name is introduced.
> > >
> > > I have no idea how to get this fixed because gimple-range-* is new to
> > > me; I tried looking into it but calling has_def_chain/get_def_chain
> > > inside register_dependency seems wrong, maybe Andrew MacLeod can help
> > > here.
> > > This happens even with a stage 1 gcc so it is not miscompiling.
> > >
> > > Also sorry for the breakage, I was not expecting it this time around
> > > as I ran bootstrap like three times and I did not expect an
> > > interaction with other parts of the compiler like this.
> > >
> > > Thanks,
> > > Andrew Pinski
> > >
> > >
> > > >
> > > > Thanks,
> > > > Andrew
> > > >
> > > >
> > > >
> > > >
> > > > >
> > > > > home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
> > > > > during GIMPLE pass: evrp
> > > > > ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
> > > > > ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
> > > > > 155 | }
> > > > > | ^
> > > > > 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
> > > > > ../../gcc-trunk/gcc/vec.h:890
> > > > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
> > > > > ../../gcc-trunk/gcc/tree.h:3366
> > > > > 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
> > > > > ../../gcc-trunk/gcc/vec.h:1461
> > > > > 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
> > > > > ../../gcc-trunk/gcc/gimple-range-gori.cc:179
> > > > > 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:439
> > > > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > > > 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:431
> > > > > 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:376
> > > > > 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:1067
> > > > > 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:1097
> > > > > 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
> > > > > ../../gcc-trunk/gcc/gimple-range.cc:980
> > > > > 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
> > > > > ../../gcc-trunk/gcc/value-query.cc:86
> > > > > 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
> > > > > ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
> > > > > 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
> > > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
> > > > > 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
> > > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
> > > > > 0x183921f dom_walker::walk(basic_block_def*)
> > > > > ../../gcc-trunk/gcc/domwalk.c:309
> > > > > 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
> > > > > ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
> > > > > Please submit a full bug report,
> > > > > with preprocessed source if appropriate.
> > > > > Please include the complete backtrace with any bug report.
> > > > > See <https://gcc.gnu.org/bugs/> for instructions.
> > > > > make[2]: *** [Makefile:76: fixtests.o] Error 1
> > > > > make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
> > > > > make[1]: *** [Makefile:3827: all-fixincludes] Error 2
> > > > > make[1]: Leaving directory '/home/ed/gnu/gcc-build'
> > > > > make: *** [Makefile:1011: all] Error 2
> > > > >
> > > > >
> > > > > Bernd.
> > > > >
> > > > >
> > > > > >> Thanks,
> > > > > >> Andrew Pinski
> > > > > >>
> > > > > >> gcc:
> > > > > >> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
> > > > > >> A?POW2:0 and A?0:POW2.
> > > > > >> ---
> > > > > >> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
> > > > > >> 1 file changed, 41 insertions(+)
> > > > > >>
> > > > > >> diff --git a/gcc/match.pd b/gcc/match.pd
> > > > > >> index 1fc6b7b1557..ad6b057c56d 100644
> > > > > >> --- a/gcc/match.pd
> > > > > >> +++ b/gcc/match.pd
> > > > > >> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > > > > >> (if (integer_all_onesp (@1) && integer_zerop (@2))
> > > > > >> @0))))
> > > > > >>
> > > > > >> +/* A few simplifications of "a ? CST1 : CST2". */
> > > > > >> +/* NOTE: Only do this on gimple as the if-chain-to-switch
> > > > > >> + optimization depends on the gimple to have if statements in it. */
> > > > > >> +#if GIMPLE
> > > > > >> +(simplify
> > > > > >> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
> > > > > >> + (switch
> > > > > >> + (if (integer_zerop (@2))
> > > > > >> + (switch
> > > > > >> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
> > > > > >> + (if (integer_onep (@1))
> > > > > >> + (convert (convert:boolean_type_node @0)))
> > > > > >> + /* a ? -1 : 0 -> -a. */
> > > > > >> + (if (integer_all_onesp (@1))
> > > > > >> + (negate (convert (convert:boolean_type_node @0))))
> > > > > >> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
> > > > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
> > > > > >> + (with {
> > > > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
> > > > > >> + }
> > > > > >> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
> > > > > >> + (if (integer_zerop (@1))
> > > > > >> + (with {
> > > > > >> + tree booltrue = constant_boolean_node (true, boolean_type_node);
> > > > > >> + }
> > > > > >> + (switch
> > > > > >> + /* a ? 0 : 1 -> !a. */
> > > > > >> + (if (integer_onep (@2))
> > > > > >> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
> > > > > >> + /* a ? -1 : 0 -> -(!a). */
> > > > > >> + (if (integer_all_onesp (@2))
> > > > > >> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
> > > > > >> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
> > > > > >> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
> > > > > >> + (with {
> > > > > >> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
> > > > > >> + }
> > > > > >> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
> > > > > >> + { shift; }))))))))
> > > > > >> +#endif
> > > > > >> +
> > > > > >> /* Simplification moved from fold_cond_expr_with_comparison. It may also
> > > > > >> be extended. */
> > > > > >> /* This pattern implements two kinds simplification:
> > > > > >> --
> > > > > >> 2.17.1
> > > > > >>
> > > > > >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 11:07 ` Andrew Pinski
2021-05-26 11:27 ` Richard Biener
@ 2021-05-26 16:54 ` Aldy Hernandez
2021-05-26 17:29 ` Andrew MacLeod
2 siblings, 0 replies; 16+ messages in thread
From: Aldy Hernandez @ 2021-05-26 16:54 UTC (permalink / raw)
To: Andrew Pinski; +Cc: Bernd Edlinger, Andrew MacLeod, Andrew Pinski, GCC Patches
[-- Attachment #1: Type: text/plain, Size: 3196 bytes --]
On Wed, May 26, 2021 at 1:08 PM Andrew Pinski via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
> >
> > On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> > <bernd.edlinger@hotmail.de> wrote:
> > >
> > > On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> > > > On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> > > > <gcc-patches@gcc.gnu.org> wrote:
> > > >>
> > > >> From: Andrew Pinski <apinski@marvell.com>
> > > >>
> > > >> Instead of some of the more manual optimizations inside phi-opt,
> > > >> it would be good idea to do a lot of the heavy lifting inside match
> > > >> and simplify instead. In the process, this moves the three simple
> > > >> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> > > >>
> > > >> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> > > >>
> > > >> Differences from V1:
> > > >> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
> > > >> which are not 1 bit precision.
> > > >
> > > > OK.
> > > >
> > > > Thanks,
> > > > Richard.
> > > >
> > >
> > > Hmm, sorry, no luck.
> > >
> > > I think this caused:
> >
> > If anything it is a bad interaction with changes between r12-1046 and
> > r12-1053; I am suspecting a bug in those changes rather than my
> > changes causing the bug. Debugging it right now.
>
> (gdb) p debug_tree(name)
> <ssa_name 0x7ffff6a5cd38
> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> size <integer_cst 0x7ffff6b2bdc8 constant 8>
> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> align:8 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>
> def_stmt _19 = ~_8;
> version:19>
>
> So what is happening is evrp converted:
> ct_12 = ct_5 + -1;
> Into
> ct_12 = ct_5 == 1 ? 0 : 1;
> (this was done before my patch)
> And then it gets simplified to:
> _8 = ct_5 == 1;
> _19 = ~_8;
> ct_12 = (int) _19;
> (after my match.pd patch)
>
> Which is correct, but the range code is not expecting new SSA names to
> be added .....
> It looks like the issue was introduced with r12-1048 (Add imports and
> strengthen the export definition in range_def and gori_map).
> I suspect there are other match.pd patterns which would also hit this
> issue where a new ssa name is introduced.
>
> I have no idea how to get this fixed because gimple-range-* is new to
> me; I tried looking into it but calling has_def_chain/get_def_chain
> inside register_dependency seems wrong, maybe Andrew MacLeod can help
> here.
> This happens even with a stage 1 gcc so it is not miscompiling.
I'm attaching a source that also exhibits the same ICE.
The issue is here:
void
range_def_chain::register_dependency (tree name, tree dep, basic_block bb)
{
if (!gimple_range_ssa_p (dep))
return;
unsigned v = SSA_NAME_VERSION (name);
=>struct rdc &src = m_def_chain[v];
gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
unsigned dep_v = SSA_NAME_VERSION (dep);
The SSA name is x_19, but the length m_def_chain is 19, so m_def_chain[19] ICEs.
Aldy
[-- Attachment #2: a.i --]
[-- Type: application/octet-stream, Size: 146017 bytes --]
# 0 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
# 1 "/home/aldyh/bld/ranger-cfun/t/fixincludes//"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
# 48 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
# 1 "/home/aldyh/src/gcc/fixincludes/fixlib.h" 1
# 28 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
# 1 "./config.h" 1
# 29 "/home/aldyh/src/gcc/fixincludes/fixlib.h" 2
# 1 "/home/aldyh/src/gcc/fixincludes/system.h" 1
# 27 "/home/aldyh/src/gcc/fixincludes/system.h"
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stdarg.h" 1 3 4
# 40 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stdarg.h" 3 4
# 40 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 99 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 28 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 143 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 209 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 321 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 3 4
typedef int wchar_t;
# 415 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 3 4
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 426 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 3 4
} max_align_t;
# 31 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 450 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 452 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 453 "/usr/include/sys/cdefs.h" 2 3 4
# 1 "/usr/include/bits/long-double.h" 1 3 4
# 454 "/usr/include/sys/cdefs.h" 2 3 4
# 451 "/usr/include/features.h" 2 3 4
# 474 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4
# 10 "/usr/include/gnu/stubs.h" 3 4
# 1 "/usr/include/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/gnu/stubs.h" 2 3 4
# 475 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/bits/libc-header-start.h" 2 3 4
# 28 "/usr/include/stdio.h" 2 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types.h" 1 3 4
# 27 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 28 "/usr/include/bits/types.h" 2 3 4
# 1 "/usr/include/bits/timesize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 142 "/usr/include/bits/types.h" 2 3 4
# 1 "/usr/include/bits/time64.h" 1 3 4
# 143 "/usr/include/bits/types.h" 2 3 4
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/__fpos_t.h" 1 3 4
# 1 "/usr/include/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/bits/types/__mbstate_t.h" 3 4
typedef struct
{
int __count;
union
{
unsigned int __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 6 "/usr/include/bits/types/__fpos_t.h" 2 3 4
typedef struct _G_fpos_t
{
__off_t __pos;
__mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
__off64_t __pos;
__mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/__FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;
typedef void _IO_lock_t;
struct _IO_FILE
{
int _flags;
char *_IO_read_ptr;
char *_IO_read_end;
char *_IO_read_base;
char *_IO_write_base;
char *_IO_write_ptr;
char *_IO_write_end;
char *_IO_buf_base;
char *_IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
struct _IO_FILE *_freeres_list;
void *_freeres_buf;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types/cookie_io_functions_t.h" 1 3 4
# 27 "/usr/include/bits/types/cookie_io_functions_t.h" 3 4
typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
size_t __nbytes);
typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
size_t __nbytes);
typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);
typedef int cookie_close_function_t (void *__cookie);
typedef struct _IO_cookie_io_functions_t
{
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
# 47 "/usr/include/stdio.h" 2 3 4
# 63 "/usr/include/stdio.h" 3 4
typedef __off_t off_t;
typedef __off64_t off64_t;
typedef __ssize_t ssize_t;
typedef __fpos_t fpos_t;
typedef __fpos64_t fpos64_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));
extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));
extern int renameat (int __oldfd, const char *__old, int __newfd,
const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 164 "/usr/include/stdio.h" 3 4
extern int renameat2 (int __oldfd, const char *__old, int __newfd,
const char *__new, unsigned int __flags) __attribute__ ((__nothrow__ , __leaf__));
extern FILE *tmpfile (void) ;
# 183 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile64 (void) ;
extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
# 204 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern int fclose (FILE *__stream);
extern int fflush (FILE *__stream);
# 227 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 237 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 246 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
# 270 "/usr/include/stdio.h" 3 4
extern FILE *fopen64 (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen64 (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;
extern FILE *fopencookie (void *__restrict __magic_cookie,
const char *__restrict __modes,
cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__ , __leaf__)) ;
extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
__attribute__ ((__nothrow__ , __leaf__)) ;
extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) __attribute__ ((__nothrow__ , __leaf__));
extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int fprintf (FILE *__restrict __stream,
const char *__restrict __format, ...);
extern int printf (const char *__restrict __format, ...);
extern int sprintf (char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__));
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg);
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg) __attribute__ ((__nothrow__));
extern int snprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
__gnuc_va_list __arg)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int vdprintf (int __fd, const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) ;
extern int scanf (const char *__restrict __format, ...) ;
extern int sscanf (const char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));
extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
;
extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
;
extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__))
;
# 432 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__format__ (__scanf__, 2, 0)));
# 485 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);
extern int getchar (void);
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 510 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 521 "/usr/include/stdio.h" 3 4
extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);
extern int putchar (int __c);
# 537 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);
extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
extern int getw (FILE *__stream);
extern int putw (int __w, FILE *__stream);
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
# 587 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
FILE *__restrict __stream) ;
# 603 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) ;
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
extern int puts (const char *__s);
extern int ungetc (int __c, FILE *__stream);
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s);
# 662 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (const char *__restrict __s,
FILE *__restrict __stream);
# 673 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream);
# 707 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);
extern __off_t ftello (FILE *__stream) ;
# 731 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
extern int fsetpos (FILE *__stream, const fpos_t *__pos);
# 750 "/usr/include/stdio.h" 3 4
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void perror (const char *__s);
# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 26 "/usr/include/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern const char *const sys_errlist[];
extern int _sys_nerr;
extern const char *const _sys_errlist[];
# 782 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 800 "/usr/include/stdio.h" 3 4
extern FILE *popen (const char *__command, const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));
extern char *cuserid (char *__s);
struct obstack;
extern int obstack_printf (struct obstack *__restrict __obstack,
const char *__restrict __format, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
const char *__restrict __format,
__gnuc_va_list __args)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));
extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 858 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 1 "/usr/include/bits/stdio.h" 1 3 4
# 38 "/usr/include/bits/stdio.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar (void)
{
return getc (stdin);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fgetc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar_unlocked (void)
{
return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar (int __c)
{
return putc (__c, stdout);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fputc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar_unlocked (int __c)
{
return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) feof_unlocked (FILE *__stream)
{
return (((__stream)->_flags & 0x0010) != 0);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) ferror_unlocked (FILE *__stream)
{
return (((__stream)->_flags & 0x0020) != 0);
}
# 865 "/usr/include/stdio.h" 2 3 4
# 873 "/usr/include/stdio.h" 3 4
# 34 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 168 "/home/aldyh/src/gcc/fixincludes/system.h"
# 1 "/usr/include/sys/types.h" 1 3 4
# 27 "/usr/include/sys/types.h" 3 4
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
# 97 "/usr/include/sys/types.h" 3 4
typedef __pid_t pid_t;
typedef __id_t id_t;
# 114 "/usr/include/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 1 "/usr/include/bits/types/clock_t.h" 1 3 4
typedef __clock_t clock_t;
# 127 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/bits/types/clockid_t.h" 1 3 4
typedef __clockid_t clockid_t;
# 129 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/bits/types/time_t.h" 1 3 4
typedef __time_t time_t;
# 130 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/bits/types/timer_t.h" 1 3 4
typedef __timer_t timer_t;
# 131 "/usr/include/sys/types.h" 2 3 4
typedef __useconds_t useconds_t;
typedef __suseconds_t suseconds_t;
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 145 "/usr/include/sys/types.h" 2 3 4
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 1 "/usr/include/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 156 "/usr/include/sys/types.h" 2 3 4
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef int register_t __attribute__ ((__mode__ (__word__)));
# 176 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 36 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 2 3 4
# 60 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/byteswap.h" 1 3 4
# 33 "/usr/include/bits/byteswap.h" 3 4
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
return __builtin_bswap16 (__bsx);
}
static __inline __uint32_t
__bswap_32 (__uint32_t __bsx)
{
return __builtin_bswap32 (__bsx);
}
# 69 "/usr/include/bits/byteswap.h" 3 4
__extension__ static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{
return __builtin_bswap64 (__bsx);
}
# 61 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
return __x;
}
static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
return __x;
}
static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
return __x;
}
# 62 "/usr/include/endian.h" 2 3 4
# 177 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
# 30 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/bits/select.h" 1 3 4
# 22 "/usr/include/bits/select.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 23 "/usr/include/bits/select.h" 2 3 4
# 31 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/bits/types/sigset_t.h" 1 3 4
# 1 "/usr/include/bits/types/__sigset_t.h" 1 3 4
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/bits/types/sigset_t.h" 2 3 4
typedef __sigset_t sigset_t;
# 34 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/bits/types/struct_timeval.h" 1 3 4
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
# 38 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/bits/types/struct_timespec.h" 1 3 4
# 9 "/usr/include/bits/types/struct_timespec.h" 3 4
struct timespec
{
__time_t tv_sec;
__syscall_slong_t tv_nsec;
};
# 40 "/usr/include/sys/select.h" 2 3 4
# 49 "/usr/include/sys/select.h" 3 4
typedef long int __fd_mask;
# 59 "/usr/include/sys/select.h" 3 4
typedef struct
{
__fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
# 91 "/usr/include/sys/select.h" 3 4
# 101 "/usr/include/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
# 113 "/usr/include/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask);
# 126 "/usr/include/sys/select.h" 3 4
# 180 "/usr/include/sys/types.h" 2 3 4
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 219 "/usr/include/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/bits/thread-shared-types.h" 1 3 4
# 77 "/usr/include/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 22 "/usr/include/bits/pthreadtypes-arch.h" 2 3 4
# 65 "/usr/include/bits/pthreadtypes-arch.h" 3 4
struct __pthread_rwlock_arch_t
{
unsigned int __readers;
unsigned int __writers;
unsigned int __wrphase_futex;
unsigned int __writers_futex;
unsigned int __pad3;
unsigned int __pad4;
int __cur_writer;
int __shared;
signed char __rwelision;
unsigned char __pad1[7];
unsigned long int __pad2;
unsigned int __flags;
# 99 "/usr/include/bits/pthreadtypes-arch.h" 3 4
};
# 78 "/usr/include/bits/thread-shared-types.h" 2 3 4
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
struct __pthread_internal_list *__next;
} __pthread_list_t;
# 118 "/usr/include/bits/thread-shared-types.h" 3 4
struct __pthread_mutex_s
{
int __lock ;
unsigned int __count;
int __owner;
unsigned int __nusers;
# 148 "/usr/include/bits/thread-shared-types.h" 3 4
int __kind;
short __spins; short __elision;
__pthread_list_t __list;
# 165 "/usr/include/bits/thread-shared-types.h" 3 4
};
struct __pthread_cond_s
{
__extension__ union
{
__extension__ unsigned long long int __wseq;
struct
{
unsigned int __low;
unsigned int __high;
} __wseq32;
};
__extension__ union
{
__extension__ unsigned long long int __g1_start;
struct
{
unsigned int __low;
unsigned int __high;
} __g1_start32;
};
unsigned int __g_refs[2] ;
unsigned int __g_size[2];
unsigned int __g1_orig_size;
unsigned int __wrefs;
unsigned int __g_signals[2];
};
# 24 "/usr/include/bits/pthreadtypes.h" 2 3 4
typedef unsigned long int pthread_t;
typedef union
{
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union
{
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
union pthread_attr_t
{
char __size[56];
long int __align;
};
typedef union pthread_attr_t pthread_attr_t;
typedef union
{
struct __pthread_mutex_s __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union
{
struct __pthread_cond_s __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
struct __pthread_rwlock_arch_t __data;
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[4];
int __align;
} pthread_barrierattr_t;
# 228 "/usr/include/sys/types.h" 2 3 4
# 169 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/bits/errno.h" 1 3 4
# 26 "/usr/include/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 2 "/usr/include/asm/errno.h" 2 3 4
# 2 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4
extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern char *program_invocation_name;
extern char *program_invocation_short_name;
# 1 "/usr/include/bits/types/error_t.h" 1 3 4
# 22 "/usr/include/bits/types/error_t.h" 3 4
typedef int error_t;
# 49 "/usr/include/errno.h" 2 3 4
# 170 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 180 "/home/aldyh/src/gcc/fixincludes/system.h"
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memmove (void *__dest, const void *__src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 91 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 104 "/usr/include/string.h" 3 4
extern void *rawmemchr (const void *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 115 "/usr/include/string.h" 3 4
extern void *memrchr (const void *__s, int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcoll (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strxfrm (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 1 "/usr/include/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/bits/types/locale_t.h" 3 4
# 1 "/usr/include/bits/types/__locale_t.h" 1 3 4
# 28 "/usr/include/bits/types/__locale_t.h" 3 4
struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
};
typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/bits/types/locale_t.h" 2 3 4
typedef __locale_t locale_t;
# 154 "/usr/include/string.h" 2 3 4
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern char *strdup (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
extern char *strndup (const char *__string, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 226 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 253 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 266 "/usr/include/string.h" 3 4
extern char *strchrnul (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strcspn (const char *__s, const char *__reject)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strspn (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 303 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 330 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *__strtok_r (char *__restrict __s,
const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 360 "/usr/include/string.h" 3 4
extern char *strcasestr (const char *__haystack, const char *__needle)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memmem (const void *__haystack, size_t __haystacklen,
const void *__needle, size_t __needlelen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
extern void *__mempcpy (void *__restrict __dest,
const void *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *mempcpy (void *__restrict __dest,
const void *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strlen (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strnlen (const char *__string, size_t __maxlen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 421 "/usr/include/string.h" 3 4
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bcopy (const void *__src, void *__dest, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int strcasecmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int strncasecmp_l (const char *__s1, const char *__s2,
size_t __n, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
# 433 "/usr/include/string.h" 2 3 4
extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char *strsep (char **__restrict __stringp,
const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *__stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strverscmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strfry (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 487 "/usr/include/string.h" 3 4
extern char *basename (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 499 "/usr/include/string.h" 3 4
# 181 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 25 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/bits/libc-header-start.h" 1 3 4
# 26 "/usr/include/stdlib.h" 2 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 32 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/bits/waitflags.h" 1 3 4
# 40 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/bits/waitstatus.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 55 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/bits/floatn.h" 1 3 4
# 119 "/usr/include/bits/floatn.h" 3 4
# 1 "/usr/include/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/bits/floatn-common.h" 3 4
# 1 "/usr/include/bits/long-double.h" 1 3 4
# 25 "/usr/include/bits/floatn-common.h" 2 3 4
# 120 "/usr/include/bits/floatn.h" 2 3 4
# 56 "/usr/include/stdlib.h" 2 3 4
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
# 97 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
extern double atof (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern float strtof (const char *__restrict __nptr,
char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long double strtold (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 140 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32 (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern _Float64 strtof64 (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern _Float128 strtof128 (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern _Float32x strtof32x (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern _Float64x strtof64x (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 176 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern unsigned long int strtoul (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoll (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int strfromd (char *__dest, size_t __size, const char *__format,
double __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfromf (char *__dest, size_t __size, const char *__format,
float __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfroml (char *__dest, size_t __size, const char *__format,
long double __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 232 "/usr/include/stdlib.h" 3 4
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
_Float32 __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfromf64 (char *__dest, size_t __size, const char * __format,
_Float64 __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfromf128 (char *__dest, size_t __size, const char * __format,
_Float128 __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfromf32x (char *__dest, size_t __size, const char * __format,
_Float32x __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int strfromf64x (char *__dest, size_t __size, const char * __format,
_Float64x __f)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
# 274 "/usr/include/stdlib.h" 3 4
extern long int strtol_l (const char *__restrict __nptr,
char **__restrict __endptr, int __base,
locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));
extern unsigned long int strtoul_l (const char *__restrict __nptr,
char **__restrict __endptr,
int __base, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));
__extension__
extern long long int strtoll_l (const char *__restrict __nptr,
char **__restrict __endptr, int __base,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));
__extension__
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
char **__restrict __endptr,
int __base, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 4)));
extern double strtod_l (const char *__restrict __nptr,
char **__restrict __endptr, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern float strtof_l (const char *__restrict __nptr,
char **__restrict __endptr, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern long double strtold_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 316 "/usr/include/stdlib.h" 3 4
extern _Float32 strtof32_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern _Float64 strtof64_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern _Float128 strtof128_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern _Float32x strtof32x_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
extern _Float64x strtof64x_l (const char *__restrict __nptr,
char **__restrict __endptr,
locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
# 360 "/usr/include/stdlib.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) atoi (const char *__nptr)
{
return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline __attribute__ ((__gnu_inline__)) long int
__attribute__ ((__nothrow__ , __leaf__)) atol (const char *__nptr)
{
return strtol (__nptr, (char **) ((void *)0), 10);
}
__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
__attribute__ ((__nothrow__ , __leaf__)) atoll (const char *__nptr)
{
return strtoll (__nptr, (char **) ((void *)0), 10);
}
# 385 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
extern long int a64l (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 401 "/usr/include/stdlib.h" 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
__extension__ unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern void *calloc (size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ;
extern void *realloc (void *__ptr, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2)));
extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__))
__attribute__ ((__alloc_size__ (2, 3)));
extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4
extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
# 569 "/usr/include/stdlib.h" 2 3 4
extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__))
__attribute__ ((__alloc_size__ (1))) ;
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern void *aligned_alloc (size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern char *secure_getenv (const char *__name)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int setenv (const char *__name, const char *__value, int __replace)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 675 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 688 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 698 "/usr/include/stdlib.h" 3 4
extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 710 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
# 720 "/usr/include/stdlib.h" 3 4
extern int mkstemps64 (char *__template, int __suffixlen)
__attribute__ ((__nonnull__ (1))) ;
# 731 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 742 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 752 "/usr/include/stdlib.h" 3 4
extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 762 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 774 "/usr/include/stdlib.h" 3 4
extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 784 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
extern char *canonicalize_file_name (const char *__name)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 800 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
typedef int (*__compar_fn_t) (const void *, const void *);
typedef __compar_fn_t comparison_fn_t;
typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
extern void *bsearch (const void *__key, const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
# 1 "/usr/include/bits/stdlib-bsearch.h" 1 3 4
# 19 "/usr/include/bits/stdlib-bsearch.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) void *
bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar)
{
size_t __l, __u, __idx;
const void *__p;
int __comparison;
__l = 0;
__u = __nmemb;
while (__l < __u)
{
__idx = (__l + __u) / 2;
__p = (void *) (((const char *) __base) + (__idx * __size));
__comparison = (*__compar) (__key, __p);
if (__comparison < 0)
__u = __idx;
else if (__comparison > 0)
__l = __idx + 1;
else
return (void *) __p;
}
return ((void *)0);
}
# 826 "/usr/include/stdlib.h" 2 3 4
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
__compar_d_fn_t __compar, void *__arg)
__attribute__ ((__nonnull__ (1, 4)));
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 872 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *gcvt (double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int mbtowc (wchar_t *__restrict __pwc,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern size_t wcstombs (char *__restrict __s,
const wchar_t *__restrict __pwcs, size_t __n)
__attribute__ ((__nothrow__ , __leaf__));
extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 957 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
char *const *__restrict __tokens,
char **__restrict __valuep)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
extern int posix_openpt (int __oflag) ;
extern int grantpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int unlockpt (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern char *ptsname (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int getpt (void);
extern int getloadavg (double __loadavg[], int __nelem)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1013 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/bits/stdlib-float.h" 1 3 4
# 24 "/usr/include/bits/stdlib-float.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) double
__attribute__ ((__nothrow__ , __leaf__)) atof (const char *__nptr)
{
return strtod (__nptr, (char **) ((void *)0));
}
# 1014 "/usr/include/stdlib.h" 2 3 4
# 1023 "/usr/include/stdlib.h" 3 4
# 189 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4
# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4
# 1 "/usr/include/bits/environments.h" 1 3 4
# 22 "/usr/include/bits/environments.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 23 "/usr/include/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
# 267 "/usr/include/unistd.h" 3 4
typedef __intptr_t intptr_t;
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int euidaccess (const char *__name, int __type)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int eaccess (const char *__name, int __type)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int faccessat (int __fd, const char *__file, int __type, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 334 "/usr/include/unistd.h" 3 4
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__));
# 345 "/usr/include/unistd.h" 3 4
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
__attribute__ ((__nothrow__ , __leaf__));
extern int close (int __fd);
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
extern ssize_t write (int __fd, const void *__buf, size_t __n) ;
# 376 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
__off_t __offset) ;
extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
__off_t __offset) ;
# 404 "/usr/include/unistd.h" 3 4
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
__off64_t __offset) ;
extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
__off64_t __offset) ;
extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int pipe2 (int __pipedes[2], int __flags) __attribute__ ((__nothrow__ , __leaf__)) ;
# 432 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
__attribute__ ((__nothrow__ , __leaf__));
extern int usleep (__useconds_t __useconds);
# 469 "/usr/include/unistd.h" 3 4
extern int pause (void);
extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchownat (int __fd, const char *__file, __uid_t __owner,
__gid_t __group, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 511 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;
extern char *get_current_dir_name (void) __attribute__ ((__nothrow__ , __leaf__));
extern char *getwd (char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));
extern int dup3 (int __fd, int __fd2, int __flags) __attribute__ ((__nothrow__ , __leaf__));
extern char **__environ;
extern char **environ;
extern int execve (const char *__path, char *const __argv[],
char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int execv (const char *__path, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execle (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execl (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execvp (const char *__file, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execlp (const char *__file, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execvpe (const char *__file, char *const __argv[],
char *const __envp[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void _exit (int __status) __attribute__ ((__noreturn__));
# 1 "/usr/include/bits/confname.h" 1 3 4
# 24 "/usr/include/bits/confname.h" 3 4
enum
{
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_MAX_INPUT,
_PC_NAME_MAX,
_PC_PATH_MAX,
_PC_PIPE_BUF,
_PC_CHOWN_RESTRICTED,
_PC_NO_TRUNC,
_PC_VDISABLE,
_PC_SYNC_IO,
_PC_ASYNC_IO,
_PC_PRIO_IO,
_PC_SOCK_MAXBUF,
_PC_FILESIZEBITS,
_PC_REC_INCR_XFER_SIZE,
_PC_REC_MAX_XFER_SIZE,
_PC_REC_MIN_XFER_SIZE,
_PC_REC_XFER_ALIGN,
_PC_ALLOC_SIZE_MIN,
_PC_SYMLINK_MAX,
_PC_2_SYMLINKS
};
enum
{
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_CLK_TCK,
_SC_NGROUPS_MAX,
_SC_OPEN_MAX,
_SC_STREAM_MAX,
_SC_TZNAME_MAX,
_SC_JOB_CONTROL,
_SC_SAVED_IDS,
_SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING,
_SC_TIMERS,
_SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO,
_SC_SYNCHRONIZED_IO,
_SC_FSYNC,
_SC_MAPPED_FILES,
_SC_MEMLOCK,
_SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION,
_SC_MESSAGE_PASSING,
_SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS,
_SC_AIO_LISTIO_MAX,
_SC_AIO_MAX,
_SC_AIO_PRIO_DELTA_MAX,
_SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX,
_SC_VERSION,
_SC_PAGESIZE,
_SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX,
_SC_SEM_VALUE_MAX,
_SC_SIGQUEUE_MAX,
_SC_TIMER_MAX,
_SC_BC_BASE_MAX,
_SC_BC_DIM_MAX,
_SC_BC_SCALE_MAX,
_SC_BC_STRING_MAX,
_SC_COLL_WEIGHTS_MAX,
_SC_EQUIV_CLASS_MAX,
_SC_EXPR_NEST_MAX,
_SC_LINE_MAX,
_SC_RE_DUP_MAX,
_SC_CHARCLASS_NAME_MAX,
_SC_2_VERSION,
_SC_2_C_BIND,
_SC_2_C_DEV,
_SC_2_FORT_DEV,
_SC_2_FORT_RUN,
_SC_2_SW_DEV,
_SC_2_LOCALEDEF,
_SC_PII,
_SC_PII_XTI,
_SC_PII_SOCKET,
_SC_PII_INTERNET,
_SC_PII_OSI,
_SC_POLL,
_SC_SELECT,
_SC_UIO_MAXIOV,
_SC_IOV_MAX = _SC_UIO_MAXIOV,
_SC_PII_INTERNET_STREAM,
_SC_PII_INTERNET_DGRAM,
_SC_PII_OSI_COTS,
_SC_PII_OSI_CLTS,
_SC_PII_OSI_M,
_SC_T_IOV_MAX,
_SC_THREADS,
_SC_THREAD_SAFE_FUNCTIONS,
_SC_GETGR_R_SIZE_MAX,
_SC_GETPW_R_SIZE_MAX,
_SC_LOGIN_NAME_MAX,
_SC_TTY_NAME_MAX,
_SC_THREAD_DESTRUCTOR_ITERATIONS,
_SC_THREAD_KEYS_MAX,
_SC_THREAD_STACK_MIN,
_SC_THREAD_THREADS_MAX,
_SC_THREAD_ATTR_STACKADDR,
_SC_THREAD_ATTR_STACKSIZE,
_SC_THREAD_PRIORITY_SCHEDULING,
_SC_THREAD_PRIO_INHERIT,
_SC_THREAD_PRIO_PROTECT,
_SC_THREAD_PROCESS_SHARED,
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PHYS_PAGES,
_SC_AVPHYS_PAGES,
_SC_ATEXIT_MAX,
_SC_PASS_MAX,
_SC_XOPEN_VERSION,
_SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX,
_SC_XOPEN_CRYPT,
_SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM,
_SC_2_CHAR_TERM,
_SC_2_C_VERSION,
_SC_2_UPE,
_SC_XOPEN_XPG2,
_SC_XOPEN_XPG3,
_SC_XOPEN_XPG4,
_SC_CHAR_BIT,
_SC_CHAR_MAX,
_SC_CHAR_MIN,
_SC_INT_MAX,
_SC_INT_MIN,
_SC_LONG_BIT,
_SC_WORD_BIT,
_SC_MB_LEN_MAX,
_SC_NZERO,
_SC_SSIZE_MAX,
_SC_SCHAR_MAX,
_SC_SCHAR_MIN,
_SC_SHRT_MAX,
_SC_SHRT_MIN,
_SC_UCHAR_MAX,
_SC_UINT_MAX,
_SC_ULONG_MAX,
_SC_USHRT_MAX,
_SC_NL_ARGMAX,
_SC_NL_LANGMAX,
_SC_NL_MSGMAX,
_SC_NL_NMAX,
_SC_NL_SETMAX,
_SC_NL_TEXTMAX,
_SC_XBS5_ILP32_OFF32,
_SC_XBS5_ILP32_OFFBIG,
_SC_XBS5_LP64_OFF64,
_SC_XBS5_LPBIG_OFFBIG,
_SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME,
_SC_XOPEN_REALTIME_THREADS,
_SC_ADVISORY_INFO,
_SC_BARRIERS,
_SC_BASE,
_SC_C_LANG_SUPPORT,
_SC_C_LANG_SUPPORT_R,
_SC_CLOCK_SELECTION,
_SC_CPUTIME,
_SC_THREAD_CPUTIME,
_SC_DEVICE_IO,
_SC_DEVICE_SPECIFIC,
_SC_DEVICE_SPECIFIC_R,
_SC_FD_MGMT,
_SC_FIFO,
_SC_PIPE,
_SC_FILE_ATTRIBUTES,
_SC_FILE_LOCKING,
_SC_FILE_SYSTEM,
_SC_MONOTONIC_CLOCK,
_SC_MULTI_PROCESS,
_SC_SINGLE_PROCESS,
_SC_NETWORKING,
_SC_READER_WRITER_LOCKS,
_SC_SPIN_LOCKS,
_SC_REGEXP,
_SC_REGEX_VERSION,
_SC_SHELL,
_SC_SIGNALS,
_SC_SPAWN,
_SC_SPORADIC_SERVER,
_SC_THREAD_SPORADIC_SERVER,
_SC_SYSTEM_DATABASE,
_SC_SYSTEM_DATABASE_R,
_SC_TIMEOUTS,
_SC_TYPED_MEMORY_OBJECTS,
_SC_USER_GROUPS,
_SC_USER_GROUPS_R,
_SC_2_PBS,
_SC_2_PBS_ACCOUNTING,
_SC_2_PBS_LOCATE,
_SC_2_PBS_MESSAGE,
_SC_2_PBS_TRACK,
_SC_SYMLOOP_MAX,
_SC_STREAMS,
_SC_2_PBS_CHECKPOINT,
_SC_V6_ILP32_OFF32,
_SC_V6_ILP32_OFFBIG,
_SC_V6_LP64_OFF64,
_SC_V6_LPBIG_OFFBIG,
_SC_HOST_NAME_MAX,
_SC_TRACE,
_SC_TRACE_EVENT_FILTER,
_SC_TRACE_INHERIT,
_SC_TRACE_LOG,
_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC,
_SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE,
_SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC,
_SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE,
_SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE,
_SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC,
_SC_LEVEL4_CACHE_LINESIZE,
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
_SC_RAW_SOCKETS,
_SC_V7_ILP32_OFF32,
_SC_V7_ILP32_OFFBIG,
_SC_V7_LP64_OFF64,
_SC_V7_LPBIG_OFFBIG,
_SC_SS_REPL_MAX,
_SC_TRACE_EVENT_NAME_MAX,
_SC_TRACE_NAME_MAX,
_SC_TRACE_SYS_MAX,
_SC_TRACE_USER_EVENT_MAX,
_SC_XOPEN_STREAMS,
_SC_THREAD_ROBUST_PRIO_INHERIT,
_SC_THREAD_ROBUST_PRIO_PROTECT
};
enum
{
_CS_PATH,
_CS_V6_WIDTH_RESTRICTED_ENVS,
_CS_GNU_LIBC_VERSION,
_CS_GNU_LIBPTHREAD_VERSION,
_CS_V5_WIDTH_RESTRICTED_ENVS,
_CS_V7_WIDTH_RESTRICTED_ENVS,
_CS_LFS_CFLAGS = 1000,
_CS_LFS_LDFLAGS,
_CS_LFS_LIBS,
_CS_LFS_LINTFLAGS,
_CS_LFS64_CFLAGS,
_CS_LFS64_LDFLAGS,
_CS_LFS64_LIBS,
_CS_LFS64_LINTFLAGS,
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
_CS_XBS5_ILP32_OFF32_LDFLAGS,
_CS_XBS5_ILP32_OFF32_LIBS,
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
_CS_XBS5_ILP32_OFFBIG_LIBS,
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
_CS_XBS5_LP64_OFF64_CFLAGS,
_CS_XBS5_LP64_OFF64_LDFLAGS,
_CS_XBS5_LP64_OFF64_LIBS,
_CS_XBS5_LP64_OFF64_LINTFLAGS,
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LIBS,
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LIBS,
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
_CS_POSIX_V6_LP64_OFF64_LIBS,
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LIBS,
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
_CS_POSIX_V7_LP64_OFF64_LIBS,
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
_CS_V6_ENV,
_CS_V7_ENV
};
# 610 "/usr/include/unistd.h" 2 3 4
extern long int pathconf (const char *__path, int __name)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));
extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));
extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 660 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int group_member (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__));
extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
__attribute__ ((__nothrow__ , __leaf__));
extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
__attribute__ ((__nothrow__ , __leaf__));
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
__attribute__ ((__nothrow__ , __leaf__)) ;
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
__attribute__ ((__nothrow__ , __leaf__)) ;
extern __pid_t fork (void) __attribute__ ((__nothrow__));
extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));
extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));
extern int link (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int linkat (int __fromfd, const char *__from, int __tofd,
const char *__to, int __flags)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;
extern int symlink (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern ssize_t readlink (const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int symlinkat (const char *__from, int __tofd,
const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ;
extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int unlinkat (int __fd, const char *__name, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));
extern char *getlogin (void);
extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1 "/usr/include/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/bits/getopt_posix.h" 3 4
# 1 "/usr/include/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/bits/getopt_core.h" 3 4
extern char *optarg;
# 50 "/usr/include/bits/getopt_core.h" 3 4
extern int optind;
extern int opterr;
extern int optopt;
# 91 "/usr/include/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 28 "/usr/include/bits/getopt_posix.h" 2 3 4
# 49 "/usr/include/bits/getopt_posix.h" 3 4
# 870 "/usr/include/unistd.h" 2 3 4
extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sethostname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int getdomainname (char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int setdomainname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));
extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));
extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
extern int fsync (int __fd);
extern int syncfs (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern long int gethostid (void);
extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 991 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off_t __length)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1003 "/usr/include/unistd.h" 3 4
extern int truncate64 (const char *__file, __off64_t __length)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1014 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1024 "/usr/include/unistd.h" 3 4
extern int ftruncate64 (int __fd, __off64_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1035 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1056 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1079 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off_t __len) ;
# 1089 "/usr/include/unistd.h" 3 4
extern int lockf64 (int __fd, int __cmd, __off64_t __len) ;
# 1107 "/usr/include/unistd.h" 3 4
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
int __outfd, __off64_t *__poutoff,
size_t __length, unsigned int __flags);
extern int fdatasync (int __fildes);
# 1124 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void swab (const void *__restrict __from, void *__restrict __to,
ssize_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 1161 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length) ;
# 1170 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/bits/unistd_ext.h" 1 3 4
# 34 "/usr/include/bits/unistd_ext.h" 3 4
extern __pid_t gettid (void) __attribute__ ((__nothrow__ , __leaf__));
# 1171 "/usr/include/unistd.h" 2 3 4
# 193 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/bits/fcntl.h" 1 3 4
# 35 "/usr/include/bits/fcntl.h" 3 4
struct flock
{
short int l_type;
short int l_whence;
__off_t l_start;
__off_t l_len;
__pid_t l_pid;
};
struct flock64
{
short int l_type;
short int l_whence;
__off64_t l_start;
__off64_t l_len;
__pid_t l_pid;
};
# 1 "/usr/include/bits/fcntl-linux.h" 1 3 4
# 38 "/usr/include/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/bits/types/struct_iovec.h" 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 24 "/usr/include/bits/types/struct_iovec.h" 2 3 4
struct iovec
{
void *iov_base;
size_t iov_len;
};
# 39 "/usr/include/bits/fcntl-linux.h" 2 3 4
# 265 "/usr/include/bits/fcntl-linux.h" 3 4
enum __pid_type
{
F_OWNER_TID = 0,
F_OWNER_PID,
F_OWNER_PGRP,
F_OWNER_GID = F_OWNER_PGRP
};
struct f_owner_ex
{
enum __pid_type type;
__pid_t pid;
};
# 348 "/usr/include/bits/fcntl-linux.h" 3 4
# 1 "/usr/include/linux/falloc.h" 1 3 4
# 349 "/usr/include/bits/fcntl-linux.h" 2 3 4
struct file_handle
{
unsigned int handle_bytes;
int handle_type;
unsigned char f_handle[0];
};
extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__attribute__ ((__nothrow__ , __leaf__));
extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
size_t __count, unsigned int __flags);
extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
__off64_t *__offout, size_t __len,
unsigned int __flags);
extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
unsigned int __flags);
extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
# 419 "/usr/include/bits/fcntl-linux.h" 3 4
extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
__off64_t __len);
extern int name_to_handle_at (int __dfd, const char *__name,
struct file_handle *__handle, int *__mnt_id,
int __flags) __attribute__ ((__nothrow__ , __leaf__));
extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
int __flags);
# 62 "/usr/include/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/bits/stat.h" 1 3 4
# 46 "/usr/include/bits/stat.h" 3 4
struct stat
{
__dev_t st_dev;
__ino_t st_ino;
__nlink_t st_nlink;
__mode_t st_mode;
__uid_t st_uid;
__gid_t st_gid;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt_t st_blocks;
# 91 "/usr/include/bits/stat.h" 3 4
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 106 "/usr/include/bits/stat.h" 3 4
__syscall_slong_t __glibc_reserved[3];
# 115 "/usr/include/bits/stat.h" 3 4
};
struct stat64
{
__dev_t st_dev;
__ino64_t st_ino;
__nlink_t st_nlink;
__mode_t st_mode;
__uid_t st_uid;
__gid_t st_gid;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt64_t st_blocks;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 164 "/usr/include/bits/stat.h" 3 4
__syscall_slong_t __glibc_reserved[3];
};
# 79 "/usr/include/fcntl.h" 2 3 4
# 175 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...);
# 184 "/usr/include/fcntl.h" 3 4
extern int fcntl64 (int __fd, int __cmd, ...);
# 195 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 205 "/usr/include/fcntl.h" 3 4
extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 219 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...)
__attribute__ ((__nonnull__ (2)));
# 230 "/usr/include/fcntl.h" 3 4
extern int openat64 (int __fd, const char *__file, int __oflag, ...)
__attribute__ ((__nonnull__ (2)));
# 241 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 251 "/usr/include/fcntl.h" 3 4
extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 287 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, off_t __offset, off_t __len,
int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 299 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 309 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, off_t __offset, off_t __len);
# 320 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# 331 "/usr/include/fcntl.h" 3 4
# 197 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 213 "/home/aldyh/src/gcc/fixincludes/system.h"
# 1 "/usr/include/sys/stat.h" 1 3 4
# 99 "/usr/include/sys/stat.h" 3 4
# 1 "/usr/include/bits/stat.h" 1 3 4
# 102 "/usr/include/sys/stat.h" 2 3 4
# 205 "/usr/include/sys/stat.h" 3 4
extern int stat (const char *__restrict __file,
struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 224 "/usr/include/sys/stat.h" 3 4
extern int stat64 (const char *__restrict __file,
struct stat64 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int fstatat (int __fd, const char *__restrict __file,
struct stat *__restrict __buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 249 "/usr/include/sys/stat.h" 3 4
extern int fstatat64 (int __fd, const char *__restrict __file,
struct stat64 *__restrict __buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int lstat (const char *__restrict __file,
struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 272 "/usr/include/sys/stat.h" 3 4
extern int lstat64 (const char *__restrict __file,
struct stat64 *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int chmod (const char *__file, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int lchmod (const char *__file, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));
extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));
extern __mode_t getumask (void) __attribute__ ((__nothrow__ , __leaf__));
extern int mkdir (const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mknodat (int __fd, const char *__path, __mode_t __mode,
__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int mkfifo (const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int utimensat (int __fd, const char *__path,
const struct timespec __times[2],
int __flags)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 395 "/usr/include/sys/stat.h" 3 4
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int __xstat (int __ver, const char *__filename,
struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __lxstat (int __ver, const char *__filename,
struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __fxstatat (int __ver, int __fildes, const char *__filename,
struct stat *__stat_buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4)));
# 428 "/usr/include/sys/stat.h" 3 4
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int __xstat64 (int __ver, const char *__filename,
struct stat64 *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __lxstat64 (int __ver, const char *__filename,
struct stat64 *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
struct stat64 *__stat_buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4)));
extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
__dev_t *__dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int __xmknodat (int __ver, int __fd, const char *__path,
__mode_t __mode, __dev_t *__dev)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 5)));
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include-fixed/bits/statx.h" 1 3 4
# 48 "/home/aldyh/bld/ranger-cfun/t/./gcc/include-fixed/bits/statx.h" 3 4
# 1 "/usr/include/bits/statx-generic.h" 1 3 4
# 25 "/usr/include/bits/statx-generic.h" 3 4
# 1 "/usr/include/bits/types/struct_statx_timestamp.h" 1 3 4
# 26 "/usr/include/bits/types/struct_statx_timestamp.h" 3 4
struct statx_timestamp
{
__int64_t tv_sec;
__uint32_t tv_nsec;
__int32_t __statx_timestamp_pad1[1];
};
# 26 "/usr/include/bits/statx-generic.h" 2 3 4
# 1 "/usr/include/bits/types/struct_statx.h" 1 3 4
# 30 "/usr/include/bits/types/struct_statx.h" 3 4
struct statx
{
__uint32_t stx_mask;
__uint32_t stx_blksize;
__uint64_t stx_attributes;
__uint32_t stx_nlink;
__uint32_t stx_uid;
__uint32_t stx_gid;
__uint16_t stx_mode;
__uint16_t __statx_pad1[1];
__uint64_t stx_ino;
__uint64_t stx_size;
__uint64_t stx_blocks;
__uint64_t stx_attributes_mask;
struct statx_timestamp stx_atime;
struct statx_timestamp stx_btime;
struct statx_timestamp stx_ctime;
struct statx_timestamp stx_mtime;
__uint32_t stx_rdev_major;
__uint32_t stx_rdev_minor;
__uint32_t stx_dev_major;
__uint32_t stx_dev_minor;
__uint64_t __statx_pad2[14];
};
# 27 "/usr/include/bits/statx-generic.h" 2 3 4
# 53 "/usr/include/bits/statx-generic.h" 3 4
int statx (int __dirfd, const char *__restrict __path, int __flags,
unsigned int __mask, struct statx *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5)));
# 49 "/home/aldyh/bld/ranger-cfun/t/./gcc/include-fixed/bits/statx.h" 2 3 4
# 447 "/usr/include/sys/stat.h" 2 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) stat (const char *__path, struct stat *__statbuf)
{
return __xstat (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) lstat (const char *__path, struct stat *__statbuf)
{
return __lxstat (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) fstat (int __fd, struct stat *__statbuf)
{
return __fxstat (1, __fd, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag)
{
return __fxstatat (1, __fd, __filename, __statbuf, __flag);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) mknod (const char *__path, __mode_t __mode, __dev_t __dev)
{
return __xmknod (0, __path, __mode, &__dev);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev)
{
return __xmknodat (0, __fd, __path, __mode, &__dev);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) stat64 (const char *__path, struct stat64 *__statbuf)
{
return __xstat64 (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) lstat64 (const char *__path, struct stat64 *__statbuf)
{
return __lxstat64 (1, __path, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) fstat64 (int __fd, struct stat64 *__statbuf)
{
return __fxstat64 (1, __fd, __statbuf);
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)
{
return __fxstatat64 (1, __fd, __filename, __statbuf, __flag);
}
# 214 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 222 "/home/aldyh/src/gcc/fixincludes/system.h"
# 1 "/home/aldyh/src/gcc/fixincludes/../include/filenames.h" 1
# 29 "/home/aldyh/src/gcc/fixincludes/../include/filenames.h"
# 1 "/home/aldyh/src/gcc/fixincludes/../include/hashtab.h" 1
# 39 "/home/aldyh/src/gcc/fixincludes/../include/hashtab.h"
# 1 "/home/aldyh/src/gcc/fixincludes/../include/ansidecl.h" 1
# 40 "/home/aldyh/src/gcc/fixincludes/../include/hashtab.h" 2
# 42 "/home/aldyh/src/gcc/fixincludes/../include/hashtab.h"
typedef unsigned int hashval_t;
typedef hashval_t (*htab_hash) (const void *);
typedef int (*htab_eq) (const void *, const void *);
typedef void (*htab_del) (void *);
typedef int (*htab_trav) (void **, void *);
typedef void *(*htab_alloc) (size_t, size_t);
typedef void (*htab_free) (void *);
typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t);
typedef void (*htab_free_with_arg) (void *, void *);
# 95 "/home/aldyh/src/gcc/fixincludes/../include/hashtab.h"
struct htab {
htab_hash hash_f;
htab_eq eq_f;
htab_del del_f;
void **entries;
size_t size;
size_t n_elements;
size_t n_deleted;
unsigned int searches;
unsigned int collisions;
htab_alloc alloc_f;
htab_free free_f;
void *alloc_arg;
htab_alloc_with_arg alloc_with_arg_f;
htab_free_with_arg free_with_arg_f;
unsigned int size_prime_index;
};
typedef struct htab *htab_t;
enum insert_option {NO_INSERT, INSERT};
extern htab_t htab_create_alloc (size_t, htab_hash,
htab_eq, htab_del,
htab_alloc, htab_free);
extern htab_t htab_create_alloc_ex (size_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del,
htab_alloc, htab_alloc, htab_free);
extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del);
extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del);
extern void htab_set_functions_ex (htab_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern void htab_delete (htab_t);
extern void htab_empty (htab_t);
extern void * htab_find (htab_t, const void *);
extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
extern void ** htab_find_slot_with_hash (htab_t, const void *,
hashval_t, enum insert_option);
extern void htab_clear_slot (htab_t, void **);
extern void htab_remove_elt (htab_t, const void *);
extern void htab_remove_elt_with_hash (htab_t, const void *, hashval_t);
extern void htab_traverse (htab_t, htab_trav, void *);
extern void htab_traverse_noresize (htab_t, htab_trav, void *);
extern size_t htab_size (htab_t);
extern size_t htab_elements (htab_t);
extern double htab_collisions (htab_t);
extern htab_hash htab_hash_pointer;
extern htab_eq htab_eq_pointer;
extern hashval_t htab_hash_string (const void *);
extern int htab_eq_string (const void *, const void *);
extern hashval_t iterative_hash (const void *, size_t, hashval_t);
# 30 "/home/aldyh/src/gcc/fixincludes/../include/filenames.h" 2
# 84 "/home/aldyh/src/gcc/fixincludes/../include/filenames.h"
extern int filename_cmp (const char *s1, const char *s2);
extern int filename_ncmp (const char *s1, const char *s2,
size_t n);
extern hashval_t filename_hash (const void *s);
extern int filename_eq (const void *s1, const void *s2);
extern int canonical_filename_eq (const char *a, const char *b);
# 223 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h" 1
# 45 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 46 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h" 2
# 55 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern void unlock_stream (FILE *);
extern void unlock_std_streams (void);
extern FILE *fopen_unlocked (const char *, const char *);
extern FILE *fdopen_unlocked (int, const char *);
extern FILE *freopen_unlocked (const char *, const char *, FILE *);
extern char **buildargv (const char *) __attribute__ ((__malloc__));
extern void freeargv (char **);
extern char **dupargv (char * const *) __attribute__ ((__malloc__));
extern void expandargv (int *, char ***);
extern int writeargv (char * const *, FILE *);
extern int countargv (char * const *);
# 123 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const char *lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern const char *dos_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern const char *unix_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1)));
extern char *lrealpath (const char *);
extern int is_valid_fd (int fd);
extern char *concat (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
# 157 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern char *reconcat (char *, const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
extern unsigned long concat_length (const char *, ...) __attribute__ ((__sentinel__));
extern char *concat_copy (char *, const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__sentinel__));
extern char *concat_copy2 (const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__));
extern char *libiberty_concat_ptr;
# 193 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern int fdmatch (int fd1, int fd2);
# 205 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern char * getpwd (void);
# 218 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern long get_run_time (void);
extern char *make_relative_prefix (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern char *make_relative_prefix_ignore_links (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern const char *choose_tmpdir (void) __attribute__ ((__returns_nonnull__));
extern char *choose_temp_base (void) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__));
extern char *make_temp_file (const char *) __attribute__ ((__malloc__));
extern char *make_temp_file_with_prefix (const char *, const char *) __attribute__ ((__malloc__));
extern int unlink_if_ordinary (const char *);
extern const char *spaces (int count);
extern int errno_max (void);
extern const char *strerrno (int);
extern int strtoerrno (const char *);
extern char *xstrerror (int) __attribute__ ((__returns_nonnull__));
extern int signo_max (void);
# 292 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const char *strsigno (int);
extern int strtosigno (const char *);
extern int xatexit (void (*fn) (void));
extern void xexit (int status) __attribute__ ((__noreturn__));
extern void xmalloc_set_program_name (const char *);
extern void xmalloc_failed (size_t) __attribute__ ((__noreturn__));
extern void *xmalloc (size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1))) __attribute__ ((warn_unused_result));
extern void *xrealloc (void *, size_t) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (2))) __attribute__ ((warn_unused_result));
extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1, 2))) __attribute__ ((warn_unused_result));
extern char *xstrdup (const char *) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern void *xmemdup (const void *, size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result));
extern double physmem_total (void);
extern double physmem_available (void);
extern unsigned int xcrc32 (const unsigned char *, int, unsigned int);
# 391 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const unsigned char _hex_value[256];
extern void hex_init (void);
# 428 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern struct pex_obj *pex_init (int flags, const char *pname,
const char *tempbase) __attribute__ ((__returns_nonnull__));
# 528 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const char *pex_run (struct pex_obj *obj, int flags,
const char *executable, char * const *argv,
const char *outname, const char *errname,
int *err);
# 543 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const char *pex_run_in_environment (struct pex_obj *obj, int flags,
const char *executable,
char * const *argv,
char * const *env,
const char *outname,
const char *errname, int *err);
extern FILE *pex_input_file (struct pex_obj *obj, int flags,
const char *in_name);
extern FILE *pex_input_pipe (struct pex_obj *obj, int binary);
extern FILE *pex_read_output (struct pex_obj *, int binary);
extern FILE *pex_read_err (struct pex_obj *, int binary);
extern int pex_get_status (struct pex_obj *, int count, int *vector);
struct pex_time
{
unsigned long user_seconds;
unsigned long user_microseconds;
unsigned long system_seconds;
unsigned long system_microseconds;
};
extern int pex_get_times (struct pex_obj *, int count,
struct pex_time *vector);
extern void pex_free (struct pex_obj *);
# 618 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern const char *pex_one (int flags, const char *executable,
char * const *argv, const char *pname,
const char *outname, const char *errname,
int *status, int *err);
# 637 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern int pexecute (const char *, char * const *, const char *,
const char *, char **, char **, int);
extern int pwait (int, int *, int);
extern void *bsearch_r (const void *, const void *,
size_t, size_t,
int (*)(const void *, const void *, void *),
void *);
# 661 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern char *xasprintf (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 2))) __attribute__ ((__nonnull__ (1)));
# 673 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern char *xvasprintf (const char *, va_list) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 0))) __attribute__ ((__nonnull__ (1)));
# 717 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern void setproctitle (const char *name, ...);
extern void stack_limit_increase (unsigned long);
# 730 "/home/aldyh/src/gcc/fixincludes/../include/libiberty.h"
extern void *C_alloca (size_t) __attribute__ ((__malloc__));
# 226 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 1 "/home/aldyh/src/gcc/fixincludes/../include/safe-ctype.h" 1
# 57 "/home/aldyh/src/gcc/fixincludes/../include/safe-ctype.h"
enum {
_sch_isblank = 0x0001,
_sch_iscntrl = 0x0002,
_sch_isdigit = 0x0004,
_sch_islower = 0x0008,
_sch_isprint = 0x0010,
_sch_ispunct = 0x0020,
_sch_isspace = 0x0040,
_sch_isupper = 0x0080,
_sch_isxdigit = 0x0100,
_sch_isidst = 0x0200,
_sch_isvsp = 0x0400,
_sch_isnvsp = 0x0800,
_sch_isalpha = _sch_isupper|_sch_islower,
_sch_isalnum = _sch_isalpha|_sch_isdigit,
_sch_isidnum = _sch_isidst|_sch_isdigit,
_sch_isgraph = _sch_isalnum|_sch_ispunct,
_sch_iscppsp = _sch_isvsp|_sch_isnvsp,
_sch_isbasic = _sch_isprint|_sch_iscppsp
};
extern const unsigned short _sch_istable[256];
# 110 "/home/aldyh/src/gcc/fixincludes/../include/safe-ctype.h"
extern const unsigned char _sch_toupper[256];
extern const unsigned char _sch_tolower[256];
# 122 "/home/aldyh/src/gcc/fixincludes/../include/safe-ctype.h"
# 1 "/usr/include/ctype.h" 1 3 4
# 28 "/usr/include/ctype.h" 3 4
# 46 "/usr/include/ctype.h" 3 4
# 46 "/usr/include/ctype.h" 3 4
enum
{
_ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
_ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
_ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
_ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
_ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
_ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
_ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
_ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
_ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
_IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
_ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
_ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
};
# 79 "/usr/include/ctype.h" 3 4
extern const unsigned short int **__ctype_b_loc (void)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_tolower_loc (void)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern const __int32_t **__ctype_toupper_loc (void)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 108 "/usr/include/ctype.h" 3 4
extern int isalnum (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha (int) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int islower (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint (int) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit (int) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower (int __c) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper (int __c) __attribute__ ((__nothrow__ , __leaf__));
extern int isblank (int) __attribute__ ((__nothrow__ , __leaf__));
extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__ , __leaf__));
extern int isascii (int __c) __attribute__ ((__nothrow__ , __leaf__));
extern int toascii (int __c) __attribute__ ((__nothrow__ , __leaf__));
extern int _toupper (int) __attribute__ ((__nothrow__ , __leaf__));
extern int _tolower (int) __attribute__ ((__nothrow__ , __leaf__));
# 206 "/usr/include/ctype.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) tolower (int __c)
{
return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
}
extern __inline __attribute__ ((__gnu_inline__)) int
__attribute__ ((__nothrow__ , __leaf__)) toupper (int __c)
{
return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
}
# 251 "/usr/include/ctype.h" 3 4
extern int isalnum_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isalpha_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int iscntrl_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int islower_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isgraph_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isprint_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int ispunct_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isspace_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isupper_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isxdigit_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int isblank_l (int, locale_t) __attribute__ ((__nothrow__ , __leaf__));
extern int __tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int tolower_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int __toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
extern int toupper_l (int __c, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 327 "/usr/include/ctype.h" 3 4
# 123 "/home/aldyh/src/gcc/fixincludes/../include/safe-ctype.h" 2
# 227 "/home/aldyh/src/gcc/fixincludes/system.h" 2
# 30 "/home/aldyh/src/gcc/fixincludes/fixlib.h" 2
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4
# 1 "/usr/include/bits/signum.h" 1 3 4
# 26 "/usr/include/bits/signum.h" 3 4
# 1 "/usr/include/bits/signum-generic.h" 1 3 4
# 27 "/usr/include/bits/signum.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/types/sig_atomic_t.h" 1 3 4
typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/bits/types/siginfo_t.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/bits/types/siginfo_t.h" 2 3 4
# 1 "/usr/include/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/bits/types/__sigval_t.h" 3 4
union sigval
{
int sival_int;
void *sival_ptr;
};
typedef union sigval __sigval_t;
# 7 "/usr/include/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/bits/types/siginfo_t.h" 3 4
typedef struct
{
int si_signo;
int si_errno;
int si_code;
int __pad0;
union
{
int _pad[((128 / sizeof (int)) - 4)];
struct
{
__pid_t si_pid;
__uid_t si_uid;
} _kill;
struct
{
int si_tid;
int si_overrun;
__sigval_t si_sigval;
} _timer;
struct
{
__pid_t si_pid;
__uid_t si_uid;
__sigval_t si_sigval;
} _rt;
struct
{
__pid_t si_pid;
__uid_t si_uid;
int si_status;
__clock_t si_utime;
__clock_t si_stime;
} _sigchld;
struct
{
void *si_addr;
short int si_addr_lsb;
union
{
struct
{
void *_lower;
void *_upper;
} _addr_bnd;
__uint32_t _pkey;
} _bounds;
} _sigfault;
struct
{
long int si_band;
int si_fd;
} _sigpoll;
struct
{
void *_call_addr;
int _syscall;
unsigned int _arch;
} _sigsys;
} _sifields;
} siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/bits/siginfo-consts.h" 3 4
enum
{
SI_ASYNCNL = -60,
SI_DETHREAD = -7,
SI_TKILL,
SI_SIGIO,
SI_ASYNCIO,
SI_MESGQ,
SI_TIMER,
SI_QUEUE,
SI_USER,
SI_KERNEL = 0x80
# 66 "/usr/include/bits/siginfo-consts.h" 3 4
};
enum
{
ILL_ILLOPC = 1,
ILL_ILLOPN,
ILL_ILLADR,
ILL_ILLTRP,
ILL_PRVOPC,
ILL_PRVREG,
ILL_COPROC,
ILL_BADSTK,
ILL_BADIADDR
};
enum
{
FPE_INTDIV = 1,
FPE_INTOVF,
FPE_FLTDIV,
FPE_FLTOVF,
FPE_FLTUND,
FPE_FLTRES,
FPE_FLTINV,
FPE_FLTSUB,
FPE_FLTUNK = 14,
FPE_CONDTRAP
};
enum
{
SEGV_MAPERR = 1,
SEGV_ACCERR,
SEGV_BNDERR,
SEGV_PKUERR,
SEGV_ACCADI,
SEGV_ADIDERR,
SEGV_ADIPERR
};
enum
{
BUS_ADRALN = 1,
BUS_ADRERR,
BUS_OBJERR,
BUS_MCEERR_AR,
BUS_MCEERR_AO
};
enum
{
TRAP_BRKPT = 1,
TRAP_TRACE,
TRAP_BRANCH,
TRAP_HWBKPT,
TRAP_UNK
};
enum
{
CLD_EXITED = 1,
CLD_KILLED,
CLD_DUMPED,
CLD_TRAPPED,
CLD_STOPPED,
CLD_CONTINUED
};
enum
{
POLL_IN = 1,
POLL_OUT,
POLL_MSG,
POLL_ERR,
POLL_PRI,
POLL_HUP
};
# 1 "/usr/include/bits/siginfo-consts-arch.h" 1 3 4
# 210 "/usr/include/bits/siginfo-consts.h" 2 3 4
# 59 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/types/sigevent_t.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
{
__sigval_t sigev_value;
int sigev_signo;
int sigev_notify;
union
{
int _pad[((64 / sizeof (int)) - 4)];
__pid_t _tid;
struct
{
void (*_function) (__sigval_t);
pthread_attr_t *_attribute;
} _sigev_thread;
} _sigev_un;
} sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/bits/sigevent-consts.h" 3 4
enum
{
SIGEV_SIGNAL = 0,
SIGEV_NONE,
SIGEV_THREAD,
SIGEV_THREAD_ID = 4
};
# 68 "/usr/include/signal.h" 2 3 4
typedef void (*__sighandler_t) (int);
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern void psignal (int __sig, const char *__s);
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 151 "/usr/include/signal.h" 3 4
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
# 170 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 185 "/usr/include/signal.h" 3 4
typedef __sighandler_t sighandler_t;
typedef __sighandler_t sig_t;
extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigismember (const sigset_t *__set, int __signo)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigisemptyset (const sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigandset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int sigorset (sigset_t *__set, const sigset_t *__left,
const sigset_t *__right) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
# 1 "/usr/include/bits/sigaction.h" 1 3 4
# 27 "/usr/include/bits/sigaction.h" 3 4
struct sigaction
{
union
{
__sighandler_t sa_handler;
void (*sa_sigaction) (int, siginfo_t *, void *);
}
__sigaction_handler;
__sigset_t sa_mask;
int sa_flags;
void (*sa_restorer) (void);
};
# 227 "/usr/include/signal.h" 2 3 4
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));
extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));
extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
__attribute__ ((__nonnull__ (1, 2)));
extern int sigwaitinfo (const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
extern int sigtimedwait (const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
const struct timespec *__restrict __timeout)
__attribute__ ((__nonnull__ (1)));
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
__attribute__ ((__nothrow__ , __leaf__));
# 286 "/usr/include/signal.h" 3 4
extern const char *const _sys_siglist[(64 + 1)];
extern const char *const sys_siglist[(64 + 1)];
# 1 "/usr/include/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
__uint32_t magic1;
__uint32_t extended_size;
__uint64_t xstate_bv;
__uint32_t xstate_size;
__uint32_t __glibc_reserved1[7];
};
struct _fpreg
{
unsigned short significand[4];
unsigned short exponent;
};
struct _fpxreg
{
unsigned short significand[4];
unsigned short exponent;
unsigned short __glibc_reserved1[3];
};
struct _xmmreg
{
__uint32_t element[4];
};
# 123 "/usr/include/bits/sigcontext.h" 3 4
struct _fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _fpxreg _st[8];
struct _xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
struct sigcontext
{
__uint64_t r8;
__uint64_t r9;
__uint64_t r10;
__uint64_t r11;
__uint64_t r12;
__uint64_t r13;
__uint64_t r14;
__uint64_t r15;
__uint64_t rdi;
__uint64_t rsi;
__uint64_t rbp;
__uint64_t rbx;
__uint64_t rdx;
__uint64_t rax;
__uint64_t rcx;
__uint64_t rsp;
__uint64_t rip;
__uint64_t eflags;
unsigned short cs;
unsigned short gs;
unsigned short fs;
unsigned short __pad0;
__uint64_t err;
__uint64_t trapno;
__uint64_t oldmask;
__uint64_t cr2;
__extension__ union
{
struct _fpstate * fpstate;
__uint64_t __fpstate_word;
};
__uint64_t __reserved1 [8];
};
struct _xsave_hdr
{
__uint64_t xstate_bv;
__uint64_t __glibc_reserved1[2];
__uint64_t __glibc_reserved2[5];
};
struct _ymmh_state
{
__uint32_t ymmh_space[64];
};
struct _xstate
{
struct _fpstate fpstate;
struct _xsave_hdr xstate_hdr;
struct _ymmh_state ymmh;
};
# 292 "/usr/include/signal.h" 2 3 4
extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 302 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/bits/types/stack_t.h" 3 4
# 1 "/home/aldyh/bld/ranger-cfun/t/./gcc/include/stddef.h" 1 3 4
# 24 "/usr/include/bits/types/stack_t.h" 2 3 4
typedef struct
{
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
# 304 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/sys/ucontext.h" 1 3 4
# 37 "/usr/include/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];
enum
{
REG_R8 = 0,
REG_R9,
REG_R10,
REG_R11,
REG_R12,
REG_R13,
REG_R14,
REG_R15,
REG_RDI,
REG_RSI,
REG_RBP,
REG_RBX,
REG_RDX,
REG_RAX,
REG_RCX,
REG_RSP,
REG_RIP,
REG_EFL,
REG_CSGSFS,
REG_ERR,
REG_TRAPNO,
REG_OLDMASK,
REG_CR2
};
struct _libc_fpxreg
{
unsigned short int significand[4];
unsigned short int exponent;
unsigned short int __glibc_reserved1[3];
};
struct _libc_xmmreg
{
__uint32_t element[4];
};
struct _libc_fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
typedef struct _libc_fpstate *fpregset_t;
typedef struct
{
gregset_t gregs;
fpregset_t fpregs;
__extension__ unsigned long long __reserved1 [8];
} mcontext_t;
typedef struct ucontext_t
{
unsigned long int uc_flags;
struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
__extension__ unsigned long long int __ssp[4];
} ucontext_t;
# 307 "/usr/include/signal.h" 2 3 4
extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/bits/sigstack.h" 1 3 4
# 317 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/bits/ss_flags.h" 3 4
enum
{
SS_ONSTACK = 1,
SS_DISABLE
};
# 318 "/usr/include/signal.h" 2 3 4
extern int sigaltstack (const stack_t *__restrict __ss,
stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/bits/types/struct_sigstack.h" 3 4
struct sigstack
{
void *ss_sp;
int ss_onstack;
};
# 328 "/usr/include/signal.h" 2 3 4
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
extern int sighold (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int sigrelse (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int sigignore (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/bits/sigthread.h" 1 3 4
# 31 "/usr/include/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
const __sigset_t *__restrict __newmask,
__sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));
extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));
extern int pthread_sigqueue (pthread_t __threadid, int __signo,
const union sigval __value) __attribute__ ((__nothrow__ , __leaf__));
# 360 "/usr/include/signal.h" 2 3 4
extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));
extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/bits/signal_ext.h" 1 3 4
# 29 "/usr/include/bits/signal_ext.h" 3 4
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
# 375 "/usr/include/signal.h" 2 3 4
# 31 "/home/aldyh/src/gcc/fixincludes/fixlib.h" 2
# 1 "/home/aldyh/src/gcc/fixincludes/../include/xregex.h" 1
# 27 "/home/aldyh/src/gcc/fixincludes/../include/xregex.h"
# 1 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h" 1
# 45 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
# 45 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
typedef long int s_reg_t;
typedef unsigned long int active_reg_t;
typedef unsigned long int reg_syntax_t;
# 173 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
extern reg_syntax_t xre_syntax_options;
# 290 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
typedef enum
{
REG_ENOSYS = -1,
REG_NOERROR = 0,
REG_NOMATCH,
REG_BADPAT,
REG_ECOLLATE,
REG_ECTYPE,
REG_EESCAPE,
REG_ESUBREG,
REG_EBRACK,
REG_EPAREN,
REG_EBRACE,
REG_BADBR,
REG_ERANGE,
REG_ESPACE,
REG_BADRPT,
REG_EEND,
REG_ESIZE,
REG_ERPAREN
} reg_errcode_t;
# 330 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
struct re_pattern_buffer
{
unsigned char *buffer;
unsigned long int allocated;
unsigned long int used;
reg_syntax_t syntax;
char *fastmap;
char * translate;
size_t re_nsub;
unsigned can_be_null : 1;
# 375 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
unsigned regs_allocated : 2;
unsigned fastmap_accurate : 1;
unsigned no_sub : 1;
unsigned not_bol : 1;
unsigned not_eol : 1;
unsigned newline_anchor : 1;
};
typedef struct re_pattern_buffer regex_t;
typedef int xregoff_t;
struct re_registers
{
unsigned num_regs;
xregoff_t *start;
xregoff_t *end;
};
# 425 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
typedef struct
{
xregoff_t rm_so;
xregoff_t rm_eo;
} regmatch_t;
# 441 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
extern reg_syntax_t xre_set_syntax (reg_syntax_t syntax);
extern const char *xre_compile_pattern (const char *pattern, size_t length,
struct re_pattern_buffer *buffer);
extern int xre_compile_fastmap (struct re_pattern_buffer *buffer);
extern int xre_search (struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range,
struct re_registers *regs);
extern int xre_search_2 (struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs,
int stop);
extern int xre_match (struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs);
extern int xre_match_2 (struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop);
# 498 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
extern void xre_set_registers (struct re_pattern_buffer *buffer,
struct re_registers *regs,
unsigned num_regs, xregoff_t *starts,
xregoff_t *ends);
extern char *xre_comp (const char *);
extern int xre_exec (const char *);
# 534 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
extern int xregcomp (regex_t *__restrict __preg,
const char *__restrict __pattern,
int __cflags);
__extension__
extern int xregexec (const regex_t *__restrict __preg,
const char *__restrict __string, size_t __nmatch,
regmatch_t __pmatch[
# 543 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h" 3 4
__restrict
# 543 "/home/aldyh/src/gcc/fixincludes/../include/xregex2.h"
],
int __eflags);
extern size_t xregerror (int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size);
extern void xregfree (regex_t *__preg);
# 28 "/home/aldyh/src/gcc/fixincludes/../include/xregex.h" 2
# 33 "/home/aldyh/src/gcc/fixincludes/fixlib.h" 2
# 62 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
typedef int t_success;
# 110 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
typedef enum t_bool
{
BOOL_FALSE, BOOL_TRUE
} t_bool;
typedef int apply_fix_p_t;
# 149 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
extern const char* pz_machine; extern const char* pz_orig_dir; extern const char* pz_src_dir; extern const char* pz_input_dir; extern const char* pz_dest_dir; extern const char* pz_mn_name_pat; extern const char* pz_verbose; extern const char* pz_find_base; extern const char* pz_test_mode;
# 162 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
typedef enum
{
TT_TEST, TT_EGREP, TT_NEGREP, TT_FUNCTION, TT_CKSUM
} te_test_type;
typedef struct test_desc tTestDesc;
struct test_desc
{
te_test_type type;
const char *pz_test_text;
regex_t *p_test_regex;
};
typedef struct patch_desc tPatchDesc;
# 195 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
typedef struct fix_desc tFixDesc;
struct fix_desc
{
const char* fix_name;
const char* file_list;
const char** papz_machs;
int test_ct;
int fd_flags;
tTestDesc* p_test_desc;
const char** patch_args;
long unused;
};
typedef struct {
int type_name_len;
const char* pz_type;
const char* pz_TYPE;
const char* pz_gtype;
} t_gnu_type_map;
extern int gnu_type_map_ct;
typedef enum {
VERB_SILENT = 0,
VERB_FIXES,
VERB_APPLIES,
VERB_PROGRESS,
VERB_TESTS,
VERB_EVERYTHING
} te_verbose;
extern te_verbose verbose_level;
typedef enum {
TESTING_OFF = 0,
TESTING_ON = 1
} fixinc_mode_t;
extern fixinc_mode_t fixinc_mode;
# 249 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
char * load_file_data ( FILE* fp );
# 259 "/home/aldyh/src/gcc/fixincludes/fixlib.h"
void compile_re ( const char* pat, regex_t* re, int match, const char *e1, const char *e2 );
void apply_fix ( tFixDesc* p_fixd, const char* filname );
apply_fix_p_t
run_test ( const char* t_name, const char* f_name, const char* text );
t_bool mn_get_regexps ( regex_t** label_re, regex_t** name_re, const char *who );
void initialize_opts ( void );
# 49 "/home/aldyh/src/gcc/fixincludes/fixtests.c" 2
extern char const * pz_machine; extern char const * pz_orig_dir; extern char const * pz_src_dir; extern char const * pz_input_dir; extern char const * pz_dest_dir; extern char const * pz_mn_name_pat; extern char const * pz_verbose; extern char const * pz_find_base; extern char const * pz_test_mode;
typedef apply_fix_p_t t_test_proc ( const char* file, const char* text );
typedef struct {
const char* test_name;
t_test_proc* test_proc;
} test_entry_t;
# 69 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
extern apply_fix_p_t machine_name_test ( const char* fname __attribute__ ((__unused__)), const char* text __attribute__ ((__unused__)) );
extern apply_fix_p_t stdc_0_in_system_headers_test ( const char* fname __attribute__ ((__unused__)), const char* text __attribute__ ((__unused__)) );
# 135 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
apply_fix_p_t
run_test( const char* tname, const char* fname, const char* text )
{
static test_entry_t test_table[] = { { "machine_name", machine_name_test }, { "stdc_0_in_system_headers", stdc_0_in_system_headers_test }, {
# 139 "/home/aldyh/src/gcc/fixincludes/fixtests.c" 3 4
((void *)0)
# 139 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
,
# 139 "/home/aldyh/src/gcc/fixincludes/fixtests.c" 3 4
((void *)0)
# 139 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
}};
int ct = ((sizeof (test_table) / sizeof ((test_table)[0]))-1);
test_entry_t* pte = test_table;
do
{
if (strcmp( pte->test_name, tname ) == 0)
return (*pte->test_proc)( fname, text );
pte++;
} while (--ct > 0);
fprintf(
# 152 "/home/aldyh/src/gcc/fixincludes/fixtests.c" 3 4
stderr
# 152 "/home/aldyh/src/gcc/fixincludes/fixtests.c"
, "fixincludes error: the `%s' fix test is unknown\n",
tname );
exit( 3 );
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 12:05 ` Richard Biener
@ 2021-05-26 16:59 ` Andrew MacLeod
2021-05-26 17:03 ` Bernd Edlinger
1 sibling, 0 replies; 16+ messages in thread
From: Andrew MacLeod @ 2021-05-26 16:59 UTC (permalink / raw)
To: Richard Biener, Andrew Pinski; +Cc: Bernd Edlinger, Andrew Pinski, GCC Patches
On 5/26/21 8:05 AM, Richard Biener wrote:
> On Wed, May 26, 2021 at 1:37 PM Andrew Pinski <pinskia@gmail.com> wrote:
>> On Wed, May 26, 2021 at 4:28 AM Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>>>>> <bernd.edlinger@hotmail.de> wrote:
>>>>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>>>>
>>>>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>>>>> and simplify instead. In the process, this moves the three simple
>>>>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>>>>
>>>>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>>>>
>>>>>>>> Differences from V1:
>>>>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>>>>>>>> which are not 1 bit precision.
>>>>>>> OK.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Richard.
>>>>>>>
>>>>>> Hmm, sorry, no luck.
>>>>>>
>>>>>> I think this caused:
>>>>> If anything it is a bad interaction with changes between r12-1046 and
>>>>> r12-1053; I am suspecting a bug in those changes rather than my
>>>>> changes causing the bug. Debugging it right now.
>>>> (gdb) p debug_tree(name)
>>>> <ssa_name 0x7ffff6a5cd38
>>>> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
>>>> size <integer_cst 0x7ffff6b2bdc8 constant 8>
>>>> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
>>>> align:8 warn_if_not_align:0 symtab:0 alias-set -1
>>>> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
>>>> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>>>>
>>>> def_stmt _19 = ~_8;
>>>> version:19>
>>>>
>>>> So what is happening is evrp converted:
>>>> ct_12 = ct_5 + -1;
>>>> Into
>>>> ct_12 = ct_5 == 1 ? 0 : 1;
>>>> (this was done before my patch)
>>> Note this COND_EXPR is supposed to be combined
>>> with its single use in a GIMPLE_COND ...
>> I Noticed it was not doing it (before my patch) inside evrp either.
> I think it is at most done in forwprop, but even then it likely
> lacks a fold pattern - we only seem to forward comparisons
> into GIMPLE_CONDs explicitely, leaving the rest to
> match.pd patterns.
>
>>>> And then it gets simplified to:
>>>> _8 = ct_5 == 1;
>>>> _19 = ~_8;
>>>> ct_12 = (int) _19;
>>>> (after my match.pd patch)
>>> which this one then breaks. I suppose instead of replacing
>>> ct_12 adjusting the GIMPLE_COND directly might be
>>> a better approach ... or not folding the generated COND_EXPR.
>> I was going to try to see where COND_EXPR is created but it is late
>> and there seems to be other issues going on too.
>> For example, the above really should have been converted to:
>> _19 = ct_5 != 1;
>> ct_12 = (int) _19;
>>
>> This might be a gimple-match issue where the conditional part is
>> always emitted without being simplified with the ~ part; COND_EXPR has
>> those kind of issues :).
> No, we always re-simplify things, but there might be no
> (bit_not (eq @0 integer_onep)) simplifier.
>
> Oddly enough
>
> _Bool foo (int x)
> {
> _Bool tem = x == 1;
> return ~tem;
> }
>
> is simplified to return 1 via matching
>
> /* Fold ~X op C as X op' ~C, where op' is the swapped comparison. */
> (for cmp (simple_comparison)
> scmp (swapped_simple_comparison)
> (simplify
> (cmp (bit_not@2 @0) CONSTANT_CLASS_P@1)
> (if (single_use (@2)
> && (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST))
> (scmp @0 (bit_not @1)))))
>
> Richard.
>
>
Which actually looks enticingly similar to what I'm seeing in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100774.
IN that code,
Folding statement: _1 = ~b_6;
is not turning ~[1,1] into [0,0] but rather leaving it as varying. it
eventually fills the values in
_1 = 0;
if (_1 != 0)
goto <bb 4>; [INV
but it doesnt simply properly.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 12:05 ` Richard Biener
2021-05-26 16:59 ` Andrew MacLeod
@ 2021-05-26 17:03 ` Bernd Edlinger
2021-05-26 17:07 ` Bernd Edlinger
1 sibling, 1 reply; 16+ messages in thread
From: Bernd Edlinger @ 2021-05-26 17:03 UTC (permalink / raw)
To: Richard Biener, Andrew Pinski; +Cc: Andrew MacLeod, Andrew Pinski, GCC Patches
On 5/26/21 2:05 PM, Richard Biener wrote:
> On Wed, May 26, 2021 at 1:37 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>
>> On Wed, May 26, 2021 at 4:28 AM Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>>
>>> On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>
>>>> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>>
>>>>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>>>>> <bernd.edlinger@hotmail.de> wrote:
>>>>>>
>>>>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>>>>>
>>>>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>>>>
>>>>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>>>>> and simplify instead. In the process, this moves the three simple
>>>>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>>>>
>>>>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>>>>
>>>>>>>> Differences from V1:
>>>>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>>>>>>>> which are not 1 bit precision.
>>>>>>>
>>>>>>> OK.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Richard.
>>>>>>>
>>>>>>
>>>>>> Hmm, sorry, no luck.
>>>>>>
>>>>>> I think this caused:
>>>>>
>>>>> If anything it is a bad interaction with changes between r12-1046 and
>>>>> r12-1053; I am suspecting a bug in those changes rather than my
>>>>> changes causing the bug. Debugging it right now.
>>>>
>>>> (gdb) p debug_tree(name)
>>>> <ssa_name 0x7ffff6a5cd38
>>>> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
>>>> size <integer_cst 0x7ffff6b2bdc8 constant 8>
>>>> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
>>>> align:8 warn_if_not_align:0 symtab:0 alias-set -1
>>>> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
>>>> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>>>>
>>>> def_stmt _19 = ~_8;
>>>> version:19>
>>>>
>>>> So what is happening is evrp converted:
>>>> ct_12 = ct_5 + -1;
>>>> Into
>>>> ct_12 = ct_5 == 1 ? 0 : 1;
>>>> (this was done before my patch)
>>>
>>> Note this COND_EXPR is supposed to be combined
>>> with its single use in a GIMPLE_COND ...
>>
>> I Noticed it was not doing it (before my patch) inside evrp either.
>
> I think it is at most done in forwprop, but even then it likely
> lacks a fold pattern - we only seem to forward comparisons
> into GIMPLE_CONDs explicitely, leaving the rest to
> match.pd patterns.
>
How about this for a quick fix:
commit b71621f51bc2819bb7d202efabc17fec5cc92f8f
Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
Date: Wed May 26 18:45:09 2021 +0200
Fix gcc-bootstrap issue
... or at least try to.
2021-05-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gimple-range-gori.cc (range_def_chain::register_dependency):
Resize m_def_chain when needed.
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index a4c4bf5..722bf5d 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -177,6 +177,8 @@ range_def_chain::register_dependency (tree name, tree dep, basic_block bb)
unsigned v = SSA_NAME_VERSION (name);
struct rdc &src = m_def_chain[v];
+ if (v >= m_def_chain.length ())
+ m_def_chain.safe_grow_cleared (num_ssa_names + 1);
gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
unsigned dep_v = SSA_NAME_VERSION (dep);
bitmap b;
Should I push this?
Or has anyone a better idea?
Thanks
Bernd.
>>>
>>>> And then it gets simplified to:
>>>> _8 = ct_5 == 1;
>>>> _19 = ~_8;
>>>> ct_12 = (int) _19;
>>>> (after my match.pd patch)
>>>
>>> which this one then breaks. I suppose instead of replacing
>>> ct_12 adjusting the GIMPLE_COND directly might be
>>> a better approach ... or not folding the generated COND_EXPR.
>>
>> I was going to try to see where COND_EXPR is created but it is late
>> and there seems to be other issues going on too.
>> For example, the above really should have been converted to:
>> _19 = ct_5 != 1;
>> ct_12 = (int) _19;
>>
>> This might be a gimple-match issue where the conditional part is
>> always emitted without being simplified with the ~ part; COND_EXPR has
>> those kind of issues :).
>
> No, we always re-simplify things, but there might be no
> (bit_not (eq @0 integer_onep)) simplifier.
>
> Oddly enough
>
> _Bool foo (int x)
> {
> _Bool tem = x == 1;
> return ~tem;
> }
>
> is simplified to return 1 via matching
>
> /* Fold ~X op C as X op' ~C, where op' is the swapped comparison. */
> (for cmp (simple_comparison)
> scmp (swapped_simple_comparison)
> (simplify
> (cmp (bit_not@2 @0) CONSTANT_CLASS_P@1)
> (if (single_use (@2)
> && (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST))
> (scmp @0 (bit_not @1)))))
>
> Richard.
>
>> Thanks,
>> Andrew Pinski
>>
>>
>>>
>>>> Which is correct, but the range code is not expecting new SSA names to
>>>> be added .....
>>>> It looks like the issue was introduced with r12-1048 (Add imports and
>>>> strengthen the export definition in range_def and gori_map).
>>>> I suspect there are other match.pd patterns which would also hit this
>>>> issue where a new ssa name is introduced.
>>>>
>>>> I have no idea how to get this fixed because gimple-range-* is new to
>>>> me; I tried looking into it but calling has_def_chain/get_def_chain
>>>> inside register_dependency seems wrong, maybe Andrew MacLeod can help
>>>> here.
>>>> This happens even with a stage 1 gcc so it is not miscompiling.
>>>>
>>>> Also sorry for the breakage, I was not expecting it this time around
>>>> as I ran bootstrap like three times and I did not expect an
>>>> interaction with other parts of the compiler like this.
>>>>
>>>> Thanks,
>>>> Andrew Pinski
>>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>> Andrew
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
>>>>>> during GIMPLE pass: evrp
>>>>>> ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
>>>>>> ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
>>>>>> 155 | }
>>>>>> | ^
>>>>>> 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
>>>>>> ../../gcc-trunk/gcc/vec.h:890
>>>>>> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
>>>>>> ../../gcc-trunk/gcc/tree.h:3366
>>>>>> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
>>>>>> ../../gcc-trunk/gcc/vec.h:1461
>>>>>> 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
>>>>>> ../../gcc-trunk/gcc/gimple-range-gori.cc:179
>>>>>> 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:439
>>>>>> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:376
>>>>>> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1067
>>>>>> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1097
>>>>>> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:980
>>>>>> 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:431
>>>>>> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:376
>>>>>> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1067
>>>>>> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1097
>>>>>> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:980
>>>>>> 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
>>>>>> ../../gcc-trunk/gcc/value-query.cc:86
>>>>>> 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
>>>>>> ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
>>>>>> 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
>>>>>> 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
>>>>>> 0x183921f dom_walker::walk(basic_block_def*)
>>>>>> ../../gcc-trunk/gcc/domwalk.c:309
>>>>>> 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
>>>>>> Please submit a full bug report,
>>>>>> with preprocessed source if appropriate.
>>>>>> Please include the complete backtrace with any bug report.
>>>>>> See <https://gcc.gnu.org/bugs/> for instructions.
>>>>>> make[2]: *** [Makefile:76: fixtests.o] Error 1
>>>>>> make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
>>>>>> make[1]: *** [Makefile:3827: all-fixincludes] Error 2
>>>>>> make[1]: Leaving directory '/home/ed/gnu/gcc-build'
>>>>>> make: *** [Makefile:1011: all] Error 2
>>>>>>
>>>>>>
>>>>>> Bernd.
>>>>>>
>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Andrew Pinski
>>>>>>>>
>>>>>>>> gcc:
>>>>>>>> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
>>>>>>>> A?POW2:0 and A?0:POW2.
>>>>>>>> ---
>>>>>>>> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
>>>>>>>> 1 file changed, 41 insertions(+)
>>>>>>>>
>>>>>>>> diff --git a/gcc/match.pd b/gcc/match.pd
>>>>>>>> index 1fc6b7b1557..ad6b057c56d 100644
>>>>>>>> --- a/gcc/match.pd
>>>>>>>> +++ b/gcc/match.pd
>>>>>>>> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>>>>>>>> (if (integer_all_onesp (@1) && integer_zerop (@2))
>>>>>>>> @0))))
>>>>>>>>
>>>>>>>> +/* A few simplifications of "a ? CST1 : CST2". */
>>>>>>>> +/* NOTE: Only do this on gimple as the if-chain-to-switch
>>>>>>>> + optimization depends on the gimple to have if statements in it. */
>>>>>>>> +#if GIMPLE
>>>>>>>> +(simplify
>>>>>>>> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
>>>>>>>> + (switch
>>>>>>>> + (if (integer_zerop (@2))
>>>>>>>> + (switch
>>>>>>>> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
>>>>>>>> + (if (integer_onep (@1))
>>>>>>>> + (convert (convert:boolean_type_node @0)))
>>>>>>>> + /* a ? -1 : 0 -> -a. */
>>>>>>>> + (if (integer_all_onesp (@1))
>>>>>>>> + (negate (convert (convert:boolean_type_node @0))))
>>>>>>>> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
>>>>>>>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
>>>>>>>> + (with {
>>>>>>>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
>>>>>>>> + }
>>>>>>>> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
>>>>>>>> + (if (integer_zerop (@1))
>>>>>>>> + (with {
>>>>>>>> + tree booltrue = constant_boolean_node (true, boolean_type_node);
>>>>>>>> + }
>>>>>>>> + (switch
>>>>>>>> + /* a ? 0 : 1 -> !a. */
>>>>>>>> + (if (integer_onep (@2))
>>>>>>>> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
>>>>>>>> + /* a ? -1 : 0 -> -(!a). */
>>>>>>>> + (if (integer_all_onesp (@2))
>>>>>>>> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
>>>>>>>> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
>>>>>>>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
>>>>>>>> + (with {
>>>>>>>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
>>>>>>>> + }
>>>>>>>> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
>>>>>>>> + { shift; }))))))))
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> /* Simplification moved from fold_cond_expr_with_comparison. It may also
>>>>>>>> be extended. */
>>>>>>>> /* This pattern implements two kinds simplification:
>>>>>>>> --
>>>>>>>> 2.17.1
>>>>>>>>
>>>>>>>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 17:03 ` Bernd Edlinger
@ 2021-05-26 17:07 ` Bernd Edlinger
2021-05-26 17:15 ` Andrew MacLeod
0 siblings, 1 reply; 16+ messages in thread
From: Bernd Edlinger @ 2021-05-26 17:07 UTC (permalink / raw)
To: Richard Biener, Andrew Pinski; +Cc: Andrew MacLeod, Andrew Pinski, GCC Patches
On 5/26/21 7:03 PM, Bernd Edlinger wrote:
> On 5/26/21 2:05 PM, Richard Biener wrote:
>> On Wed, May 26, 2021 at 1:37 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>
>>> On Wed, May 26, 2021 at 4:28 AM Richard Biener
>>> <richard.guenther@gmail.com> wrote:
>>>>
>>>> On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>>
>>>>> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>>>
>>>>>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>>>>>> <bernd.edlinger@hotmail.de> wrote:
>>>>>>>
>>>>>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>>>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>>>>>>
>>>>>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>>>>>
>>>>>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>>>>>> and simplify instead. In the process, this moves the three simple
>>>>>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>>>>>
>>>>>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>>>>>
>>>>>>>>> Differences from V1:
>>>>>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>>>>>>>>> which are not 1 bit precision.
>>>>>>>>
>>>>>>>> OK.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Richard.
>>>>>>>>
>>>>>>>
>>>>>>> Hmm, sorry, no luck.
>>>>>>>
>>>>>>> I think this caused:
>>>>>>
>>>>>> If anything it is a bad interaction with changes between r12-1046 and
>>>>>> r12-1053; I am suspecting a bug in those changes rather than my
>>>>>> changes causing the bug. Debugging it right now.
>>>>>
>>>>> (gdb) p debug_tree(name)
>>>>> <ssa_name 0x7ffff6a5cd38
>>>>> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
>>>>> size <integer_cst 0x7ffff6b2bdc8 constant 8>
>>>>> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
>>>>> align:8 warn_if_not_align:0 symtab:0 alias-set -1
>>>>> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
>>>>> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>>>>>
>>>>> def_stmt _19 = ~_8;
>>>>> version:19>
>>>>>
>>>>> So what is happening is evrp converted:
>>>>> ct_12 = ct_5 + -1;
>>>>> Into
>>>>> ct_12 = ct_5 == 1 ? 0 : 1;
>>>>> (this was done before my patch)
>>>>
>>>> Note this COND_EXPR is supposed to be combined
>>>> with its single use in a GIMPLE_COND ...
>>>
>>> I Noticed it was not doing it (before my patch) inside evrp either.
>>
>> I think it is at most done in forwprop, but even then it likely
>> lacks a fold pattern - we only seem to forward comparisons
>> into GIMPLE_CONDs explicitely, leaving the rest to
>> match.pd patterns.
>>
>
> How about this for a quick fix:
>
> commit b71621f51bc2819bb7d202efabc17fec5cc92f8f
> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
> Date: Wed May 26 18:45:09 2021 +0200
>
> Fix gcc-bootstrap issue
>
> ... or at least try to.
>
> 2021-05-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> * gimple-range-gori.cc (range_def_chain::register_dependency):
> Resize m_def_chain when needed.
>
> diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
> index a4c4bf5..722bf5d 100644
> --- a/gcc/gimple-range-gori.cc
> +++ b/gcc/gimple-range-gori.cc
> @@ -177,6 +177,8 @@ range_def_chain::register_dependency (tree name, tree dep, basic_block bb)
>
> unsigned v = SSA_NAME_VERSION (name);
> struct rdc &src = m_def_chain[v];
> + if (v >= m_def_chain.length ())
> + m_def_chain.safe_grow_cleared (num_ssa_names + 1);> gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
> unsigned dep_v = SSA_NAME_VERSION (dep);
> bitmap b;
>
>
> Should I push this?
> Or has anyone a better idea?
>
Aehm, I meant of course:
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -176,6 +176,8 @@ range_def_chain::register_dependency (tree name, tree dep, b
return;
unsigned v = SSA_NAME_VERSION (name);
+ if (v >= m_def_chain.length ())
+ m_def_chain.safe_grow_cleared (num_ssa_names + 1);
struct rdc &src = m_def_chain[v];
gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
unsigned dep_v = SSA_NAME_VERSION (dep);
>
> Thanks
> Bernd.
>
>>>>
>>>>> And then it gets simplified to:
>>>>> _8 = ct_5 == 1;
>>>>> _19 = ~_8;
>>>>> ct_12 = (int) _19;
>>>>> (after my match.pd patch)
>>>>
>>>> which this one then breaks. I suppose instead of replacing
>>>> ct_12 adjusting the GIMPLE_COND directly might be
>>>> a better approach ... or not folding the generated COND_EXPR.
>>>
>>> I was going to try to see where COND_EXPR is created but it is late
>>> and there seems to be other issues going on too.
>>> For example, the above really should have been converted to:
>>> _19 = ct_5 != 1;
>>> ct_12 = (int) _19;
>>>
>>> This might be a gimple-match issue where the conditional part is
>>> always emitted without being simplified with the ~ part; COND_EXPR has
>>> those kind of issues :).
>>
>> No, we always re-simplify things, but there might be no
>> (bit_not (eq @0 integer_onep)) simplifier.
>>
>> Oddly enough
>>
>> _Bool foo (int x)
>> {
>> _Bool tem = x == 1;
>> return ~tem;
>> }
>>
>> is simplified to return 1 via matching
>>
>> /* Fold ~X op C as X op' ~C, where op' is the swapped comparison. */
>> (for cmp (simple_comparison)
>> scmp (swapped_simple_comparison)
>> (simplify
>> (cmp (bit_not@2 @0) CONSTANT_CLASS_P@1)
>> (if (single_use (@2)
>> && (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST))
>> (scmp @0 (bit_not @1)))))
>>
>> Richard.
>>
>>> Thanks,
>>> Andrew Pinski
>>>
>>>
>>>>
>>>>> Which is correct, but the range code is not expecting new SSA names to
>>>>> be added .....
>>>>> It looks like the issue was introduced with r12-1048 (Add imports and
>>>>> strengthen the export definition in range_def and gori_map).
>>>>> I suspect there are other match.pd patterns which would also hit this
>>>>> issue where a new ssa name is introduced.
>>>>>
>>>>> I have no idea how to get this fixed because gimple-range-* is new to
>>>>> me; I tried looking into it but calling has_def_chain/get_def_chain
>>>>> inside register_dependency seems wrong, maybe Andrew MacLeod can help
>>>>> here.
>>>>> This happens even with a stage 1 gcc so it is not miscompiling.
>>>>>
>>>>> Also sorry for the breakage, I was not expecting it this time around
>>>>> as I ran bootstrap like three times and I did not expect an
>>>>> interaction with other parts of the compiler like this.
>>>>>
>>>>> Thanks,
>>>>> Andrew Pinski
>>>>>
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Andrew
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> home/ed/gnu/gcc-build/./gcc/xgcc -B/home/ed/gnu/gcc-build/./gcc/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/bin/ -B/home/ed/gnu/install/x86_64-pc-linux-gnu/lib/ -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/include -isystem /home/ed/gnu/install/x86_64-pc-linux-gnu/sys-include -fchecking=1 -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I../../gcc-trunk/fixincludes -I../include -I../../gcc-trunk/fixincludes/../include ../../gcc-trunk/fixincludes/fixtests.c
>>>>>>> during GIMPLE pass: evrp
>>>>>>> ../../gcc-trunk/fixincludes/fixtests.c: In function ‘run_test’:
>>>>>>> ../../gcc-trunk/fixincludes/fixtests.c:155:1: internal compiler error: in operator[], at vec.h:890
>>>>>>> 155 | }
>>>>>>> | ^
>>>>>>> 0x824622 vec<tree_node*, va_gc, vl_embed>::operator[](unsigned int)
>>>>>>> ../../gcc-trunk/gcc/vec.h:890
>>>>>>> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_embed>::operator[](unsigned int)
>>>>>>> ../../gcc-trunk/gcc/tree.h:3366
>>>>>>> 0x8247f0 vec<range_def_chain::rdc, va_heap, vl_ptr>::operator[](unsigned int)
>>>>>>> ../../gcc-trunk/gcc/vec.h:1461
>>>>>>> 0x8247f0 range_def_chain::register_dependency(tree_node*, tree_node*, basic_block_def*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range-gori.cc:179
>>>>>>> 0x18639bc fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:439
>>>>>>> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:376
>>>>>>> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1067
>>>>>>> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1097
>>>>>>> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:980
>>>>>>> 0x18637c7 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:431
>>>>>>> 0x1866c85 fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:376
>>>>>>> 0x1866fa2 gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1067
>>>>>>> 0x1866fa2 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:1097
>>>>>>> 0x186308a gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
>>>>>>> ../../gcc-trunk/gcc/gimple-range.cc:980
>>>>>>> 0x1149961 range_query::value_of_expr(tree_node*, gimple*)
>>>>>>> ../../gcc-trunk/gcc/value-query.cc:86
>>>>>>> 0x1871e51 hybrid_folder::value_of_expr(tree_node*, gimple*)
>>>>>>> ../../gcc-trunk/gcc/gimple-ssa-evrp.c:235
>>>>>>> 0xff9573 substitute_and_fold_engine::replace_uses_in(gimple*)
>>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:575
>>>>>>> 0xff988c substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
>>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:845
>>>>>>> 0x183921f dom_walker::walk(basic_block_def*)
>>>>>>> ../../gcc-trunk/gcc/domwalk.c:309
>>>>>>> 0xff8d15 substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
>>>>>>> ../../gcc-trunk/gcc/tree-ssa-propagate.c:987
>>>>>>> Please submit a full bug report,
>>>>>>> with preprocessed source if appropriate.
>>>>>>> Please include the complete backtrace with any bug report.
>>>>>>> See <https://gcc.gnu.org/bugs/> for instructions.
>>>>>>> make[2]: *** [Makefile:76: fixtests.o] Error 1
>>>>>>> make[2]: Leaving directory '/home/ed/gnu/gcc-build/fixincludes'
>>>>>>> make[1]: *** [Makefile:3827: all-fixincludes] Error 2
>>>>>>> make[1]: Leaving directory '/home/ed/gnu/gcc-build'
>>>>>>> make: *** [Makefile:1011: all] Error 2
>>>>>>>
>>>>>>>
>>>>>>> Bernd.
>>>>>>>
>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Andrew Pinski
>>>>>>>>>
>>>>>>>>> gcc:
>>>>>>>>> * match.pd (A?CST1:CST2): Add simplifcations for A?0:+-1, A?+-1:0,
>>>>>>>>> A?POW2:0 and A?0:POW2.
>>>>>>>>> ---
>>>>>>>>> gcc/match.pd | 41 +++++++++++++++++++++++++++++++++++++++++
>>>>>>>>> 1 file changed, 41 insertions(+)
>>>>>>>>>
>>>>>>>>> diff --git a/gcc/match.pd b/gcc/match.pd
>>>>>>>>> index 1fc6b7b1557..ad6b057c56d 100644
>>>>>>>>> --- a/gcc/match.pd
>>>>>>>>> +++ b/gcc/match.pd
>>>>>>>>> @@ -3711,6 +3711,47 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>>>>>>>>> (if (integer_all_onesp (@1) && integer_zerop (@2))
>>>>>>>>> @0))))
>>>>>>>>>
>>>>>>>>> +/* A few simplifications of "a ? CST1 : CST2". */
>>>>>>>>> +/* NOTE: Only do this on gimple as the if-chain-to-switch
>>>>>>>>> + optimization depends on the gimple to have if statements in it. */
>>>>>>>>> +#if GIMPLE
>>>>>>>>> +(simplify
>>>>>>>>> + (cond @0 INTEGER_CST@1 INTEGER_CST@2)
>>>>>>>>> + (switch
>>>>>>>>> + (if (integer_zerop (@2))
>>>>>>>>> + (switch
>>>>>>>>> + /* a ? 1 : 0 -> a if 0 and 1 are integral types. */
>>>>>>>>> + (if (integer_onep (@1))
>>>>>>>>> + (convert (convert:boolean_type_node @0)))
>>>>>>>>> + /* a ? -1 : 0 -> -a. */
>>>>>>>>> + (if (integer_all_onesp (@1))
>>>>>>>>> + (negate (convert (convert:boolean_type_node @0))))
>>>>>>>>> + /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
>>>>>>>>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@1))
>>>>>>>>> + (with {
>>>>>>>>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
>>>>>>>>> + }
>>>>>>>>> + (lshift (convert (convert:boolean_type_node @0)) { shift; })))))
>>>>>>>>> + (if (integer_zerop (@1))
>>>>>>>>> + (with {
>>>>>>>>> + tree booltrue = constant_boolean_node (true, boolean_type_node);
>>>>>>>>> + }
>>>>>>>>> + (switch
>>>>>>>>> + /* a ? 0 : 1 -> !a. */
>>>>>>>>> + (if (integer_onep (@2))
>>>>>>>>> + (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } )))
>>>>>>>>> + /* a ? -1 : 0 -> -(!a). */
>>>>>>>>> + (if (integer_all_onesp (@2))
>>>>>>>>> + (negate (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))))
>>>>>>>>> + /* a ? powerof2cst : 0 -> (!a) << (log2(powerof2cst)) */
>>>>>>>>> + (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
>>>>>>>>> + (with {
>>>>>>>>> + tree shift = build_int_cst (integer_type_node, tree_log2 (@2));
>>>>>>>>> + }
>>>>>>>>> + (lshift (convert (bit_xor (convert:boolean_type_node @0) { booltrue; } ))
>>>>>>>>> + { shift; }))))))))
>>>>>>>>> +#endif
>>>>>>>>> +
>>>>>>>>> /* Simplification moved from fold_cond_expr_with_comparison. It may also
>>>>>>>>> be extended. */
>>>>>>>>> /* This pattern implements two kinds simplification:
>>>>>>>>> --
>>>>>>>>> 2.17.1
>>>>>>>>>
>>>>>>>>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 17:07 ` Bernd Edlinger
@ 2021-05-26 17:15 ` Andrew MacLeod
0 siblings, 0 replies; 16+ messages in thread
From: Andrew MacLeod @ 2021-05-26 17:15 UTC (permalink / raw)
To: Bernd Edlinger, Richard Biener, Andrew Pinski; +Cc: Andrew Pinski, GCC Patches
On 5/26/21 1:07 PM, Bernd Edlinger wrote:
> On 5/26/21 7:03 PM, Bernd Edlinger wrote:
>> On 5/26/21 2:05 PM, Richard Biener wrote:
>>> On Wed, May 26, 2021 at 1:37 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>> On Wed, May 26, 2021 at 4:28 AM Richard Biener
>>>> <richard.guenther@gmail.com> wrote:
>>>>> On Wed, May 26, 2021 at 1:07 PM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>>> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>>>>>>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>>>>>>> <bernd.edlinger@hotmail.de> wrote:
>>>>>>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>>>>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>>>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>>>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>>>>>>
>>>>>>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>>>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>>>>>>> and simplify instead. In the process, this moves the three simple
>>>>>>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>>>>>>
>>>>>>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>>>>>>
>>>>>>>>>> Differences from V1:
>>>>>>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>>>>>>>>>> which are not 1 bit precision.
>>>>>>>>> OK.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Richard.
>>>>>>>>>
>>>>>>>> Hmm, sorry, no luck.
>>>>>>>>
>>>>>>>> I think this caused:
>>>>>>> If anything it is a bad interaction with changes between r12-1046 and
>>>>>>> r12-1053; I am suspecting a bug in those changes rather than my
>>>>>>> changes causing the bug. Debugging it right now.
>>>>>> (gdb) p debug_tree(name)
>>>>>> <ssa_name 0x7ffff6a5cd38
>>>>>> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
>>>>>> size <integer_cst 0x7ffff6b2bdc8 constant 8>
>>>>>> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
>>>>>> align:8 warn_if_not_align:0 symtab:0 alias-set -1
>>>>>> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
>>>>>> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>>>>>>
>>>>>> def_stmt _19 = ~_8;
>>>>>> version:19>
>>>>>>
>>>>>> So what is happening is evrp converted:
>>>>>> ct_12 = ct_5 + -1;
>>>>>> Into
>>>>>> ct_12 = ct_5 == 1 ? 0 : 1;
>>>>>> (this was done before my patch)
>>>>> Note this COND_EXPR is supposed to be combined
>>>>> with its single use in a GIMPLE_COND ...
>>>> I Noticed it was not doing it (before my patch) inside evrp either.
>>> I think it is at most done in forwprop, but even then it likely
>>> lacks a fold pattern - we only seem to forward comparisons
>>> into GIMPLE_CONDs explicitely, leaving the rest to
>>> match.pd patterns.
>>>
>> How about this for a quick fix:
>>
>> commit b71621f51bc2819bb7d202efabc17fec5cc92f8f
>> Author: Bernd Edlinger <bernd.edlinger@hotmail.de>
>> Date: Wed May 26 18:45:09 2021 +0200
>>
>> Fix gcc-bootstrap issue
>>
>> ... or at least try to.
>>
>> 2021-05-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
>>
>> * gimple-range-gori.cc (range_def_chain::register_dependency):
>> Resize m_def_chain when needed.
>>
>> diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
>> index a4c4bf5..722bf5d 100644
>> --- a/gcc/gimple-range-gori.cc
>> +++ b/gcc/gimple-range-gori.cc
>> @@ -177,6 +177,8 @@ range_def_chain::register_dependency (tree name, tree dep, basic_block bb)
>>
>> unsigned v = SSA_NAME_VERSION (name);
>> struct rdc &src = m_def_chain[v];
>> + if (v >= m_def_chain.length ())
>> + m_def_chain.safe_grow_cleared (num_ssa_names + 1);> gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
>> unsigned dep_v = SSA_NAME_VERSION (dep);
>> bitmap b;
>>
>>
>> Should I push this?
>> Or has anyone a better idea?
>>
> Aehm, I meant of course:
>
> --- a/gcc/gimple-range-gori.cc
> +++ b/gcc/gimple-range-gori.cc
> @@ -176,6 +176,8 @@ range_def_chain::register_dependency (tree name, tree dep, b
> return;
>
> unsigned v = SSA_NAME_VERSION (name);
> + if (v >= m_def_chain.length ())
> + m_def_chain.safe_grow_cleared (num_ssa_names + 1);
> struct rdc &src = m_def_chain[v];
> gimple *def_stmt = SSA_NAME_DEF_STMT (dep);
> unsigned dep_v = SSA_NAME_VERSION (dep);
>
>
yeah, I was just about to say this :-) when everything was
restructured, it seems there is a path to the new register_dependency
call from the temporal cache which does not do the range check...
all the other calls are gated by a call to has_def_chain() which ensures
the vector is big enough. This will be redundant in many cases, but
will do for now until I do a perf test and see whether I should so
something slightly different.
push is OK.
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 11:07 ` Andrew Pinski
2021-05-26 11:27 ` Richard Biener
2021-05-26 16:54 ` Aldy Hernandez
@ 2021-05-26 17:29 ` Andrew MacLeod
2021-05-28 4:53 ` Jeff Law
2 siblings, 1 reply; 16+ messages in thread
From: Andrew MacLeod @ 2021-05-26 17:29 UTC (permalink / raw)
To: Andrew Pinski, Bernd Edlinger; +Cc: Richard Biener, Andrew Pinski, GCC Patches
On 5/26/21 7:07 AM, Andrew Pinski wrote:
> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>> <bernd.edlinger@hotmail.de> wrote:
>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>
>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>> and simplify instead. In the process, this moves the three simple
>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>
>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>
>>>>> Differences from V1:
>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with boolean types
>>>>> which are not 1 bit precision.
>>>> OK.
>>>>
>>>> Thanks,
>>>> Richard.
>>>>
>>> Hmm, sorry, no luck.
>>>
>>> I think this caused:
>> If anything it is a bad interaction with changes between r12-1046 and
>> r12-1053; I am suspecting a bug in those changes rather than my
>> changes causing the bug. Debugging it right now.
> (gdb) p debug_tree(name)
> <ssa_name 0x7ffff6a5cd38
> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> size <integer_cst 0x7ffff6b2bdc8 constant 8>
> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> align:8 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>
> def_stmt _19 = ~_8;
> version:19>
>
> So what is happening is evrp converted:
> ct_12 = ct_5 + -1;
> Into
> ct_12 = ct_5 == 1 ? 0 : 1;
> (this was done before my patch)
> And then it gets simplified to:
> _8 = ct_5 == 1;
> _19 = ~_8;
> ct_12 = (int) _19;
> (after my match.pd patch)
>
> Which is correct, but the range code is not expecting new SSA names to
> be added .....
> It looks like the issue was introduced with r12-1048 (Add imports and
> strengthen the export definition in range_def and gori_map).
> I suspect there are other match.pd patterns which would also hit this
> issue where a new ssa name is introduced.
>
> I have no idea how to get this fixed because gimple-range-* is new to
> me; I tried looking into it but calling has_def_chain/get_def_chain
> inside register_dependency seems wrong, maybe Andrew MacLeod can help
> here.
> This happens even with a stage 1 gcc so it is not miscompiling.
>
> Also sorry for the breakage, I was not expecting it this time around
> as I ran bootstrap like three times and I did not expect an
> interaction with other parts of the compiler like this.
>
> Thanks,
> Andrew Pinski
>
>
>>
Yeah, not your fault, mine. I'm sure it would have shown up very soon
elsewhere, you were just the unlucky victim.
Sorry about that.
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-26 17:29 ` Andrew MacLeod
@ 2021-05-28 4:53 ` Jeff Law
2021-05-28 7:16 ` Richard Biener
0 siblings, 1 reply; 16+ messages in thread
From: Jeff Law @ 2021-05-28 4:53 UTC (permalink / raw)
To: Andrew MacLeod, Andrew Pinski, Bernd Edlinger; +Cc: Andrew Pinski, GCC Patches
On 5/26/2021 11:29 AM, Andrew MacLeod via Gcc-patches wrote:
> On 5/26/21 7:07 AM, Andrew Pinski wrote:
>> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
>>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
>>> <bernd.edlinger@hotmail.de> wrote:
>>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
>>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
>>>>> <gcc-patches@gcc.gnu.org> wrote:
>>>>>> From: Andrew Pinski <apinski@marvell.com>
>>>>>>
>>>>>> Instead of some of the more manual optimizations inside phi-opt,
>>>>>> it would be good idea to do a lot of the heavy lifting inside match
>>>>>> and simplify instead. In the process, this moves the three simple
>>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
>>>>>>
>>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
>>>>>>
>>>>>> Differences from V1:
>>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with
>>>>>> boolean types
>>>>>> which are not 1 bit precision.
>>>>> OK.
>>>>>
>>>>> Thanks,
>>>>> Richard.
>>>>>
>>>> Hmm, sorry, no luck.
>>>>
>>>> I think this caused:
>>> If anything it is a bad interaction with changes between r12-1046 and
>>> r12-1053; I am suspecting a bug in those changes rather than my
>>> changes causing the bug. Debugging it right now.
>> (gdb) p debug_tree(name)
>> <ssa_name 0x7ffff6a5cd38
>> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
>> size <integer_cst 0x7ffff6b2bdc8 constant 8>
>> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
>> align:8 warn_if_not_align:0 symtab:0 alias-set -1
>> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
>> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
>>
>> def_stmt _19 = ~_8;
>> version:19>
>>
>> So what is happening is evrp converted:
>> ct_12 = ct_5 + -1;
>> Into
>> ct_12 = ct_5 == 1 ? 0 : 1;
>> (this was done before my patch)
>> And then it gets simplified to:
>> _8 = ct_5 == 1;
>> _19 = ~_8;
>> ct_12 = (int) _19;
>> (after my match.pd patch)
Yup. I've chased this kind of thing down repeatedly through the years.
It's rare, but some transformations from match.pd create new SSA_NAMEs
and the various passes need to be prepared to handle that.
Jeff
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations
2021-05-28 4:53 ` Jeff Law
@ 2021-05-28 7:16 ` Richard Biener
0 siblings, 0 replies; 16+ messages in thread
From: Richard Biener @ 2021-05-28 7:16 UTC (permalink / raw)
To: Jeff Law
Cc: Andrew MacLeod, Andrew Pinski, Bernd Edlinger, Andrew Pinski,
GCC Patches
On Fri, May 28, 2021 at 7:21 AM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 5/26/2021 11:29 AM, Andrew MacLeod via Gcc-patches wrote:
> > On 5/26/21 7:07 AM, Andrew Pinski wrote:
> >> On Wed, May 26, 2021 at 2:01 AM Andrew Pinski <pinskia@gmail.com> wrote:
> >>> On Wed, May 26, 2021 at 1:43 AM Bernd Edlinger
> >>> <bernd.edlinger@hotmail.de> wrote:
> >>>> On 5/25/21 4:22 PM, Richard Biener via Gcc-patches wrote:
> >>>>> On Sun, May 23, 2021 at 12:03 PM apinski--- via Gcc-patches
> >>>>> <gcc-patches@gcc.gnu.org> wrote:
> >>>>>> From: Andrew Pinski <apinski@marvell.com>
> >>>>>>
> >>>>>> Instead of some of the more manual optimizations inside phi-opt,
> >>>>>> it would be good idea to do a lot of the heavy lifting inside match
> >>>>>> and simplify instead. In the process, this moves the three simple
> >>>>>> A?CST1:CST2 (where CST1 or CST2 is zero) simplifications.
> >>>>>>
> >>>>>> OK? Boostrapped and tested on x86_64-linux-gnu with no regressions.
> >>>>>>
> >>>>>> Differences from V1:
> >>>>>> * Use bit_xor 1 instead of bit_not to fix the problem with
> >>>>>> boolean types
> >>>>>> which are not 1 bit precision.
> >>>>> OK.
> >>>>>
> >>>>> Thanks,
> >>>>> Richard.
> >>>>>
> >>>> Hmm, sorry, no luck.
> >>>>
> >>>> I think this caused:
> >>> If anything it is a bad interaction with changes between r12-1046 and
> >>> r12-1053; I am suspecting a bug in those changes rather than my
> >>> changes causing the bug. Debugging it right now.
> >> (gdb) p debug_tree(name)
> >> <ssa_name 0x7ffff6a5cd38
> >> type <boolean_type 0x7ffff6b45b28 _Bool public unsigned QI
> >> size <integer_cst 0x7ffff6b2bdc8 constant 8>
> >> unit-size <integer_cst 0x7ffff6b2bde0 constant 1>
> >> align:8 warn_if_not_align:0 symtab:0 alias-set -1
> >> canonical-type 0x7ffff6b45b28 precision:1 min <integer_cst
> >> 0x7ffff6b4a030 0> max <integer_cst 0x7ffff6b4a060 1>>
> >>
> >> def_stmt _19 = ~_8;
> >> version:19>
> >>
> >> So what is happening is evrp converted:
> >> ct_12 = ct_5 + -1;
> >> Into
> >> ct_12 = ct_5 == 1 ? 0 : 1;
> >> (this was done before my patch)
> >> And then it gets simplified to:
> >> _8 = ct_5 == 1;
> >> _19 = ~_8;
> >> ct_12 = (int) _19;
> >> (after my match.pd patch)
> Yup. I've chased this kind of thing down repeatedly through the years.
> It's rare, but some transformations from match.pd create new SSA_NAMEs
> and the various passes need to be prepared to handle that.
You can suppress that at the expense of some missed simplifications.
Using fold_stmt_inplace will, for example, or when passing a NULL seq
arguments to the lower-level functions.
Richard.
> Jeff
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2021-05-28 7:16 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 9:41 [PATCHv2] Add a couple of A?CST1:CST2 match and simplify optimizations apinski
2021-05-25 14:22 ` Richard Biener
2021-05-26 8:28 ` Bernd Edlinger
2021-05-26 9:01 ` Andrew Pinski
2021-05-26 11:07 ` Andrew Pinski
2021-05-26 11:27 ` Richard Biener
2021-05-26 11:37 ` Andrew Pinski
2021-05-26 12:05 ` Richard Biener
2021-05-26 16:59 ` Andrew MacLeod
2021-05-26 17:03 ` Bernd Edlinger
2021-05-26 17:07 ` Bernd Edlinger
2021-05-26 17:15 ` Andrew MacLeod
2021-05-26 16:54 ` Aldy Hernandez
2021-05-26 17:29 ` Andrew MacLeod
2021-05-28 4:53 ` Jeff Law
2021-05-28 7:16 ` Richard Biener
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).