Re: On -Wmaybe-uninitialized

2025-01-30 Thread Dmitry Antipov
On 1/30/25 4:29 PM, David Malcolm wrote: Arguably the state-merging code could be smarter here; I haven't investigated the details, but have filed it as PR analyzer/118702 here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118702 Thanks. You might be also interesting in https://gcc.gnu.org/

On -Wmaybe-uninitialized

2025-01-30 Thread Dmitry Antipov
With (probably) -Wmaybe-uninitialized and/or -Wextra, shouldn't the compiler emit warning about possibly uninitialized 'y' passed to 'ddd()' in the example below? struct T { int a; int b; }; extern int bbb (struct T *, int *); extern int ccc (struct T *, int *); extern int ddd (struct T *,

[ARM] unexpected sizeof() of a complex packed type

2023-11-16 Thread Dmitry Antipov
(The following sample is taken from my LKML post at https://lkml.org/lkml/2023/11/15/213) $ cat t-build-bug.c struct vring_tx_mac { unsigned int d[3]; unsigned int ucode_cmd; } __attribute__((packed)); struct vring_rx_mac { unsigned int d0; unsigned int d1;

-Wstack-usage and alloca in loops

2014-09-22 Thread Dmitry Antipov
For the following translation unit: #include int foo (unsigned n) { int *p; if (n < 1024) p = alloca (n * sizeof (int)); else p = malloc (n * sizeof (int)); return g (p, n); } int bar (unsigned n) { int x, i, *p; for (x = 0, i = 0; i < n; i++) { if (n < 1024)

Warning about variable optimized away?

2014-08-05 Thread Dmitry Antipov
Hello, it it possible to get a kind of diagnostics if the variable is totally optimized away? For example, in: void foo (struct some_type *obj) { ... some code where 'obj' is not used ... bar (obj->some_member); ... some code where 'obj' is not used again ... baz (obj->some_member); }

Re: Weird startup issue with -fsplit-stack

2014-06-10 Thread Dmitry Antipov
On 05/21/2014 06:10 PM, Ian Lance Taylor wrote: I'm sorry, I have nothing useful to suggest. I agree that that sounds like a stack overflow, which should in general be impossible with -fsplit-stack when using the gold linker. I don't know what is happening here. I've tested with massive recur

Re: Weird startup issue with -fsplit-stack

2014-05-20 Thread Dmitry Antipov
On 05/20/2014 10:16 PM, Ian Lance Taylor wrote: This is the call to __morestack_block_signals in morestack.S. It should only be possible if __morestack_block_signals or something it calls directly has a split stack. __morestack_block_signals has the no_split_stack attribute, meaning that it sh

Weird startup issue with -fsplit-stack

2014-05-20 Thread Dmitry Antipov
Hello, I'm trying to support -fsplit-stack in GNU Emacs. The most important problem is that GC uses conservative scanning of a C stack, so I need to iterate over stack segments. I'm doing this by using __splitstack_find, as described in libgcc/generic-morestack.c; but now I'm facing the weird

Compiler support for write barrier insertion ?

2007-07-23 Thread Dmitry Antipov
Hello all, I have a question about possible cooperation between the compiler and hypothetical garbage collector. Unfortunately, my experience around GCC internals is too small, so I would like to ask compiler specialists before re-inventing an ugly bicycle... The most non-straightforward garb