Skip to content

Commit 026a157

Browse files
committed
Merge branch 'fix-stdio-pure' into zephyr-gcc-12.2.0
2 parents 72b28f6 + e5bb2c2 commit 026a157

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

gcc/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ MULTILIB_OSDIRNAMES_SPACE = $(MULTILIB_OSDIRNAMES)
21972197
MULTILIB_REQUIRED_SPACE = $(MULTILIB_REQUIRED)
21982198
MULTILIB_EXCEPTIONS_SPACE = $(MULTILIB_EXCEPTIONS)
21992199
MULTILIB_REUSE_SPACE = $(MULTILIB_REUSE)
2200-
MULTILIB_ENABLE = @multilib@
2200+
MULTILIB_ENABLE = @enable_multilib@
22012201
endif
22022202

22032203
# Use the genmultilib shell script to generate the information the gcc

gcc/config/microblaze/microblaze.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ extern enum pipeline_type microblaze_pipe;
115115
%{Zxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \
116116
%{mxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \
117117
%{mxl-gp-opt:%{G*}} %{!mxl-gp-opt: -G 0} \
118-
%{!T*: -dT xilinx.ld%s}"
118+
%{!r:%{!T*: -dT xilinx.ld%s}}"
119119

120120
/* Specs for the compiler proper */
121121

gcc/config/rx/rx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
%{msim:-lsim}%{!msim:-lnosys} \
116116
%{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
117117
--end-group \
118-
%{!T*: %{msim:%Trx-sim.ld}%{!msim:%Trx.ld}} \
118+
%{!r:%{!T*: %{msim:%Trx-sim.ld}%{!msim:%Trx.ld}}} \
119119
"
120120

121121
#undef LINK_SPEC

gcc/config/rx/rx.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2541,10 +2541,20 @@
25412541
(unspec_volatile:SI [(match_operand:BLK 1 "memory_operand") ;; String1
25422542
(match_operand:BLK 2 "memory_operand")] ;; String2
25432543
UNSPEC_CMPSTRN))
2544-
(use (match_operand:SI 3 "register_operand")) ;; Max Length
2544+
(use (match_operand:SI 3 "nonmemory_operand")) ;; Max Length
25452545
(match_operand:SI 4 "immediate_operand")] ;; Known Align
25462546
"rx_allow_string_insns"
25472547
{
2548+
bool const_len = CONST_INT_P(operands[3]);
2549+
if (const_len)
2550+
{
2551+
if (INTVAL(operands[3]) == 0)
2552+
{
2553+
emit_move_insn (operands[0], GEN_INT(0));
2554+
DONE;
2555+
}
2556+
}
2557+
25482558
rtx str1 = gen_rtx_REG (SImode, 1);
25492559
rtx str2 = gen_rtx_REG (SImode, 2);
25502560
rtx len = gen_rtx_REG (SImode, 3);
@@ -2553,6 +2563,11 @@
25532563
emit_move_insn (str2, force_operand (XEXP (operands[2], 0), NULL_RTX));
25542564
emit_move_insn (len, operands[3]);
25552565

2566+
/* Set flags in case len is zero */
2567+
if (!const_len) {
2568+
emit_insn (gen_setpsw (GEN_INT('C')));
2569+
emit_insn (gen_setpsw (GEN_INT('Z')));
2570+
}
25562571
emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
25572572
DONE;
25582573
}

libstdc++-v3/src/c++11/random.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <cstdio>
4646
#include <cctype> // For std::isdigit.
4747

48-
#if defined _GLIBCXX_HAVE_UNISTD_H && defined _GLIBCXX_HAVE_FCNTL_H
48+
#if defined _GLIBCXX_HAVE_UNISTD_H && defined _GLIBCXX_HAVE_FCNTL_H && !defined _GLIBCXX_USE_STDIO_PURE
4949
# include <unistd.h>
5050
# include <fcntl.h>
5151
// Use POSIX open, close, read etc. instead of ISO fopen, fclose, fread

0 commit comments

Comments
 (0)