Menu

#2888 WARNING: encountered NULL pcop--this is probably a compiler bug...

open
nobody
PIC14
5
2019-03-20
2019-03-17
fruitCoder
No

SDCC version:
3.7.1 #10275 (MINGW32)

build command:
sdcc -mpic14 -p16f690 --use-non-free --std-sdcc11 --opt-code-size -c main.c

Error/Warning messages:
main.c:24(genMinus):WARNING: left operand too short for result
main.c:24(genMinus):WARNING: right operand too short for result
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
WARNING: encountered NULL pcop--this is probably a compiler bug...
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
main.c:25(genMinus):WARNING: left operand too short for result
main.c:25(genMinus):WARNING: right operand too short for result
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[2] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })
popGet: (offset[3] >= AOP_SIZE(op)[2]) && (AOP_TYPE(op)[2] != { AOP_LIT, AOP_PCODE })

Code:

main.c

#include <stdint.h>

#define TABLE_SIZE          10

static const uint16_t temperatures[TABLE_SIZE] = 
{
    90, 80, 70, 60, 50,
    40, 30, 20, 10, 0 
};

static const uint16_t resistor_values[TABLE_SIZE] = 
{
    923, 1256, 1740, 2459, 3548,
    5242, 7947, 12394, 19947, 33242 
};

uint16_t interpolate_uint16_t_uint16_t( uint8_t size, uint16_t *left, uint16_t *right, uint16_t left_var)
{
    uint8_t index;
    int32_t Num, Divi;

    index = size / 2;

    Num = (int32_t)(right[index] - right[index-1]);
    Num *= (left_var - left[index-1]);
    Divi = (left[index] - left[index-1]);

    return (int16_t)Num;
}

int main(void)
{
    return interpolate_uint16_t_uint16_t(TABLE_SIZE, &resistor_values[0], &temperatures[0], 11000);
}

It builds without errors/warnings for other targets such as stm8, s08

1 Attachments

Discussion

  • fruitCoder

    fruitCoder - 2019-03-17

    return statement should be a cast to uint16_t but this does not matter for the bug report..

     
  • Philipp Klaus Krause

    • Category: other --> PIC14
     

Log in to post a comment.

Monday.com Logo