Skip to content

EDG should type-check generic overflow builtins #325

Closed

Description

@nv-cmeerw

Issue Summary

Argument types for __builtin_add_overflow, __builtin_sub_overflow, and __builtin_mul_overflow are not checked, but should be.

Reproducing Source Code

struct S {};

bool bad_struct(S value, int *result) {
  return __builtin_add_overflow(value, 1, result);
}

bool bad_pointer(int *value, int *result) {
  return __builtin_sub_overflow(value, 1, result);
}

bool bad_result(int value, float *result) {
  return __builtin_mul_overflow(value, 1, result);
}

Command-line Options

--gnu_version 150200

Type of Issue

[Front End] This code SHOULD compile with these options.

Additional Details

No response

Reproducing (Standard) Configuration(s)

linux-gcc-debug

Reproducing (Non-standard) Configuration

No response

I acknowledge that:

  • I have checked open issues and existing discussions before filing this report.
  • The reproducing source code that I have provided does not depend on headers that I have not included with my submission.
  • I have reduced the reproducing source code to the best of my ability.
  • I have selected at least one standard configuration or uploaded a non-standard configuration dump.
  • I understand code shared via this form is NOT confidential.
  • I have permission to share the reproducing source code and grant permission for the project to use the source code (or derivatives of the source code) to create tests.
  • I agree that any tests created using the reproducing source code (or deriatives of it) will be licensed under project license unless I included a LICENSE.txt file in my .zip or .tar.gz upload. If I included a LICENSE.txt file, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.

Activity

  1. added theissue type on Oct 19, 2026
  2. self-assigned this
    on Oct 19, 2026
  3. nv-cmeerw commented on Oct 28, 2026

    @nv-cmeerw
    ContributorAuthor

    Fixed by #396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions