This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 06/25] Add struct scratch_buffer and its internal helper functions


On 04/09/2015 01:07 PM, Florian Weimer wrote:
On 04/09/2015 12:18 PM, Stefan Liebler wrote:

I have another issue with tst-scratch_buffer.c on s390-32 where size_t
is an unsigned long with only 4 bytes:

Dave Miller reported that as well, see the parallel thread.

I need to figure out how to build glibc for 32-bit in a multi-arch
environment.  But 32-bit s390 could be tricky, again due to the binutils
2.24 environment.
You can use a chroot with installed 32bit-packages and start a bash with linux32.
But you are right, you need at least binutils 2.24.


gcc tst-scratch_buffer.c -c
...
tst-scratch_buffer.c: In function âdo_testâ:
tst-scratch_buffer.c:133:8: error: large integer implicitly truncated to
unsigned type [-Werror=overflow]
         && unchanged_array_size (&buf, 1ULL << 32, 0)
         ^
tst-scratch_buffer.c:134:8: error: large integer implicitly truncated to
unsigned type [-Werror=overflow]
         && unchanged_array_size (&buf, 0, 1ULL << 32)))
         ^
cc1: all warnings being treated as errors

Can you change the test and use "1ULL << 31" or make the usage of "1ULL
<< 32" conditionally?

I have a patch that adds a cast to size_t, which suppresses the warning
on 32-bit platforms.
Yes, "(size_t) (1ULL << 32)" suppresses the warning (tested with gcc 4.6.4, 4.7.4, 4.8.4, 4.9.2).



Using 1ULL << 31 would invalidate the test.

Can you make a change to the test, so that it compiles, and check if you
get the same inlining failure as Dave?

I get the following inlining failures with gcc 4.6.4/4.7.4 on 32/64bit:
In file included from tst-scratch_buffer.c:19:0:
tst-scratch_buffer.c: In function âdo_testâ:
../include/scratch_buffer.h:85:1: error: inlining failed in call to âscratch_buffer_freeâ: call is unlikely and code size would grow [-Werror=inline]
tst-scratch_buffer.c:79:25: error: called from here [-Werror=inline]
In file included from tst-scratch_buffer.c:19:0:
../include/scratch_buffer.h:85:1: error: inlining failed in call to âscratch_buffer_freeâ: call is unlikely and code size would grow [-Werror=inline]
tst-scratch_buffer.c:93:25: error: called from here [-Werror=inline]
In file included from tst-scratch_buffer.c:19:0:
../include/scratch_buffer.h:85:1: error: inlining failed in call to âscratch_buffer_freeâ: call is unlikely and code size would grow [-Werror=inline]
tst-scratch_buffer.c:119:25: error: called from here [-Werror=inline]
In file included from tst-scratch_buffer.c:19:0:
../include/scratch_buffer.h:85:1: error: inlining failed in call to âscratch_buffer_freeâ: call is unlikely and code size would grow [-Werror=inline]
tst-scratch_buffer.c:141:25: error: called from here [-Werror=inline]


Bye
Stefan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]