https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113333

--- Comment #4 from Donald Buczek <buczek at molgen dot mpg.de> ---
Great, thank you!

I wonder, if the related missed optimization opportunity should also be
reported.

#include <stdlib.h>
int f(void) {
    char **vec = calloc(1, sizeof(char *));
    if (vec) {
        // *vec = NULL;
        if (*vec)
            return 1;
    }
    return 0;
}

This resolves to nothing only if the commented-out line is added.

https://gcc.godbolt.org/z/WTar6zdne

Treat: clang gets it right.

Reply via email to