fyi, seems aarch64-specific. got no aarch64 test-setup currently.
arm-tcc, and i386-tcc showed no problems with this test case here.

On 2025-05-17 14:45, kbkp...@sina.com wrote:
>    Under Linux/aarch64, when execute a function call with one arg is a
>    struct, it pass wrong arg to the function call.
> 
>    a test code:
> 
>    mmm.c
> 
>    ```c
> 
>    #include <stdio.h>
>    struct vec {
>    float x;
>    float y;
>    };
>    void bug(float y, float x) {
>    printf("x=%f\ny=%f\n",x,y);
>    }
>    float dot(struct vec v) {
>    return 10.0;
>    }
>    void main() {
>    struct vec a;
>    a.x = 2.0;
>    a.y = 0.0;
>    bug(dot(a), dot(a));
>    }
> 
>    ```
> 
>    The correct result is :
> 
>    ```
> 
>    x=10.000000
>    y=10.000000
> 
>    ```
> 
>    But linux/aarch64 tcc output a wrong result:
> 
>    ```
> 
>    x=10.000000
> 
>    y=2.000000
> 
>    ```
>    __________________________________________________________________
> 
>    kbkp...@sina.com

> _______________________________________________
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to